Does the battery show as being fully charged?
There is a small battery on the motherboard, I remember when one of our computers lost sense of time it was usually that battery which needed replacing, maybe this is connected with your shutdowns, don't know in what way though, sorry 🙁
But you might want to try resetting the PMU and zapping the PRAM