That is a good question Dom T. A new 400Wh battery is £650 and a 500Wh battery £850. There are pattern ones available but from comments on other threads these have worked well for some and not for others. I believe the original battery can be re-celled.
Against this is the fact that a brand new bike like mine can be bought for £1600 if you wait for the right buying opportunity.
I bought my bike to perform a specific task, carry me and loaded panniers over a proper in places challenging 12/14 mile xc route to work using eco and off to get plenty of exercise and then get me home on a 10 mile road route with a few big hills in between at an average speed around 20 mph and a journey time of not much more than 30 minutes using the middle assist level to crest or climb the steeper hills quicker and eco for level slightly up slightly down bits and off for steeper downhill bits..
The gearing has been changed to be as perfect as possible to suit me and the routes I use. The tyres are more road biased than ideal for the xc route but are tough long lasting highly puncture resistant (none so far) and work well enough.
The way I use my bike is probably masking the loss of capacity that my battery must now be suffering from and I am sure that the total range must be less than when new.
However this is hardly noticeable in the way I use it (ie using 25% to 45% of the battery capacity and then charging it back to full or storing it indoors at 60% full) and I will keep using it until it is obvious I need to buy a new one.
The bike will be four years old in March 2019, I will be 58 in October and intend to retire when I am 60. Could it possible last that long. We will see. It is probably a tall order it would be six and a half years old or there about and my mileage would be up around 16000 + or -.
I love mountain biking and will want to do plenty after I am retired but may still be able to use a non electric bike, but would also be tempted by the sort of bike Eddie uses, a good hard tail electric mountain bike with tubeless oversize tyres and a dropper post.
Though there is no reason I could not adapt my bike with a better fork, tubeless oversize as possible tyres and a dropper post. There may be life in the old dog left to be had. Though by then I might want to treat myself to something brand new.