On average, Tesla batteries are at 80% capacity at 200,000 miles. So no, I haven't factored in battery replacement cost. Electrical components typically fail early if they fail at all, so any replacements would be covered under the generous battery warranty.
And there are owners that haven’t even gotten to 70% at 300,000 miles. And where gas is more expensive, and electricity is less expensive, like Washington state, the repayment period is more like 100,000 miles.
From my research the battery holds up very well over a decade plus. If someone replaces a battery it’s because of a sudden failure just like if an ICE needed a new engine or transmission. They aren’t dwindling down to 0 miles.
Even if it does wear down and doesn't meet the requirements for vehicular use, there should be some possibility of re-use or re-manufacture for fixed use, as a home or grid-battery. That should give you a core credit on the battery replacement, reducing the cost significantly. At least one company is trying this already:
Plus battery technology is getting better and better. If the battery fails in my MX after 10 years I'm pretty sure that the replacement battery will be either cheaper or more performant, or possibly even both!