Deductions & credits

See publication 523 for a discussion of which costs do and don't adjust your basis.  Most importantly, there is a difference between improvements (which do adjust basis) and repairs and maintenance (which do not).

https://www.irs.gov/forms-pubs/about-publication-523