MacBook Air shuts down when unplugged from Magsafe power adapter
I have an almost new macbook air mid 2013 running os x el capitan, one day i decided to download iMovie illegally from a website called iphonecake.com (it's a website that allows you to download free apps and stuff) i was pretty gaga about the idea of having a paid app for free so i just went for it and downloaded the app from the website, i installed it and all was pretty fine... 2 hours later, my macbook turned off randomly without any previous warning, i worried a bit, so i just turned it back on after tones of clicks on the power button, and it just turned off again, but this time immediately after turning on, and i legit worried a lot about my macbook, so i plugged it into magsafe adapter (this even though the battery was fully charged), and i noticed after that my mac didn't turn off this time, so i basically tried to unplug the mac from wall, and here it is turning back off again, i worried a lot, so what i did is delete all hard drive files and reinstall os x (cause i had a weak doubt that it was a malware hiding inside of the app), and it just worked for me.
this time, with my fully functioning mac, i decided to redownload that same app from that same website, and it happened exactly what is in the first paragraph, the macbook starts shutting down randomly and immediately after unplug from magsafe, so all i did basically was to delete the hard drive and reinstall os x again, but it just didn't work for me, now i'm really confused about the cause of the problem, is it a malware? or a battery problem? (and i'm kinda certain that it is not a battery problem 'cause when a check the battery state, it shows 'normal', and i downloaded Coconutbattery for additional information, and everything seems to be working fine, so im pretty certain that my battery is all fine...) so please guys if you have any solutions, it will be really good and kind from you, thank you...
P.S: i tried basically everything: resetting the SMC AND PRAM of the mac and it's still not working...
MacBook Air, OS X El Capitan (10.11)