My Macbook Pro 2013 had the same problem. But then I found this free python scripts with explanation:[br]
https://www.reddit.com/r/mac/comments/9pyort/apple_macbook_pro_sudden_crash_fix_for_models/
and after some month of terrible problems and an increasing frequency of random shutdowns my mackbook runs the first time without charger and any shutdown. I almost cannot believe it...
Now since 20 days it works absolutely well. I can use it as before the problem appeared. Even the weak battery (from permanently charging for a few month) works very well again.
I can really recommend this simple solution.
Jens