My Moto Z is doing the same thing, it is now useless unless plugged in. Hardly 'mobile'. This is the 2nd or 3rd expensive 'smart' phone I've had that has crapped out after a couple of years.
I won't be buying another one, no more droids either. Used iphone will do.