How to Calculate the Sales Tax when Trading in a Financed Car?

I know this will differ by state but I am just trying to understand the most widely used method here, totally hypothetical example:

  • I have a Miata trade-in valued at $20k by the dealer
  • I am financing the Miata and the loan balance is $20k so no positive or negative equity in the trade-in
  • I am buying a Stinger but want to take advantage of the huge lease cash so I am leasing the car first and then paying off the lease shortly afterwards
  • Total cap cost before tax for the Stinger lease is $15k

Question: Do I pay zero sales tax on the lease because I am trading in a car that I have already paid more than $15k in sales tax for? If so, is there anyway to benefit from the unused $5k sales tax when paying off the lease and buying the car?

Edit: I am in Colorado so would like to know about my state but feel free to share your knowledge on any state

Specify a state. No point talking hypotheticals when so many states treat it differently