This isn't really a question, but an answer. I've seen hundreds of posts online about Macs shutting down on their own.
I had this problem for a couple months. I took it to the Apple store and they told me it was either the battery or the mother board and I needed to spend a small fortune to either fix it or buy a new Mac. I was on a shoot in Vegas and the client was in a huge hurry to get the images and my computer was shutting down every minute, or so. My wife did some searching for me and sent me this. It worked perfectly for me. My computer hasn't shut down once since I did it.
So my 2013 MacBook Pro has been shutting itself down constantly. I mean every few minutes, or sooner. I was just on a three day shoot in Vegas and I had to edit a lot of images. I’d start the computer, get as far as opening some software, and the computer would shutdown. I took it to an Apple store and saw one of the Genius Guys. He said it was probably either the battery or the mother board. He didn’t know how to fix it. I searched online and found nada. I was pretty stressed to say the least with the client breathing down my next for the images that had to be added to various slideshows during the shoot. Anyway, I was moaning and complaining to Christy over the phone and later that night she sent me these instructions. She fixed it when the Mac Genius couldn’t. I think I’m going to get her a Super Hero costume! 1) reboot with CMD+R pressed. 2) open Terminal 3) type: csrutil disable, and hit the return key. 4) reboot in normal mode 5) go to: /System/Library/Extensions/ and find: AppleThunderboltNHI.kext. Take it out of the folder and put it in the trash. then, if you see: /System/Library/Extensions/AppleThunderboltNHI.kext.BAK, toss it, too. 6) reboot with CMD+R pressed 7) Open Terminal 8) type: csrutil enable, and hit enter. 9) reboot and forget about problem