I've been having problems too for the last few months. Here's a typical example of how the battery nosedives from over 30% to nothing in no time at all.
View attachment 247971
Sometimes I'll pick the phone up and find it's dead; other times I'll actually be using it and it will just die on me. Yesterday it did that and every time I rebooted it, it just died again until I was able to get to a charger, even though the battery had previously been reported at over 30%.
It would be good to know whether it is the battery or the software. I wouldn't mind having a go at changing the battery, but I don't want to spend a lot of time and worry over it if it doesn't solve anything.
Incidentally, I reported this in a thread on Motorola's forums. It seems I'm far from the only one with these problems. One of Motorola's staff suggested that I needed to do a factory reset, but that didn't achieve anything other than waste an evening setting the phone up again.