My father is using an Early 2015 MacBook Air (i5 Dual-core, 128GB SSD, 4GB RAM). He's been using it without any problem since the day he bought it, until it started turning off instantly the minute he unplugs the power cord.
This may sound like a conspiracy theory, but this problem started happening when I was browsing the Internet for a new gaming laptop (Windows) for my university use on my father's MacBook. Thereafter it started happening again and again every single time. The power cord is still usable even though the outer layer near the MagSafe has worn off and exposing the internals, but not the wire itself (my father has been using it for 4-5 years, the cable has gone yellow etc.).
This problem has been bugging my father because he always use it for his work, reading news and articles and all sorts things that required being away from the power cord given that the Macbook Air has an excellent battery life.
I tried to find solutions online and found out that many people has experienced this kind of problem since 2009 - 2016.
How do I diagnose and resolve the issue?