Self employed

so would the basis for the car disposed be the buyout price, plus lease payments, less depreciation?

And would that depreciation be for only the time frame that the car was owned or also for the lease time (using the IRS chart of course)?  I used the standard mileage method every year.  There was one year during the ownership time in which the business use percentage dipped below 50%. Am I correct that I cannot apply depreciation for that year?  Then since exchanges are no longer allowed, I take it the basis for the new car is the price before the trade in credit was applied.