Mac Air (2015) keeps shutting off immediately after being unplugged from charger My air which is 4 years old now keeps shutting off immediately if it gets disconnected from the charger. It won't even turn on if it's not plugged in. It started happening about a month ago randomly, but not consistently. At the beginning sometimes it would shut down when the battery was only at 80%. Now even though it says 100% if the charger accidentally gets pulled out it'll just turn off. 

I've tried resetting the SMC a few times but it didn't seem to do anything. I don't think I have the right screwdrivers to try to actually take the battery out myself. 

I copied the battery info below and attached a screenshot of the coconut battery. 

Does this mean I need to replace it? It's about $130 on Apple's website to get a new one. If I do need to, how can I avoid this for the future?

Thanks!

Battery Information:

  Model Information:
  Serial Number:    C0153670BW1F90MA9
  Manufacturer: DP
  Device Name:  bq20z451
  Pack Lot Code:    0
  PCB Lot Code: 0
  Firmware Version: 511
  Hardware Revision:    000a
  Cell Revision:    1200
  Charge Information:
  Charge Remaining (mAh):   6103
  Fully Charged:    Yes
  Charging: No
  Full Charge Capacity (mAh):   6280
  Health Information:
  Cycle Count:  401
  Condition:    Replace Now
  Battery Installed:    Yes
  Amperage (mA):    0
  Voltage (mV): 8460

System Power Settings:

  AC Power:
  System Sleep Timer (Minutes): 60
  Disk Sleep Timer (Minutes):   10
  Display Sleep Timer (Minutes):    60
  Wake on AC Change:    No
  Wake on Clamshell Open:   Yes
  Wake on LAN:  Yes
  AutoPowerOff Delay:   14400
  AutoPowerOff Enabled: 1
  Current Power Source: Yes
  DarkWakeBackgroundTasks:  1
  Display Sleep Uses Dim:   Yes
  GPUSwitch:    2
  Hibernate Mode:   3
  PrioritizeNetworkReachabilityOverSleep:   0
  Standby Delay:    10800
  Standby Enabled:  1
  Battery Power:
  System Sleep Timer (Minutes): 15
  Disk Sleep Timer (Minutes):   10
  Display Sleep Timer (Minutes):    15
  Wake on AC Change:    No
  Wake on Clamshell Open:   Yes
  AutoPowerOff Delay:   14400
  AutoPowerOff Enabled: 1
  DarkWakeBackgroundTasks:  0
  Display Sleep Uses Dim:   Yes
  GPUSwitch:    2
  Hibernate Mode:   3
  Reduce Brightness:    Yes
  Standby Delay:    10800
  Standby Enabled:  1

Hardware Configuration:

  UPS Installed:    No

AC Charger Information:

  Connected:    Yes
  ID:   0x07a1
  Wattage (W):  45
  Family:   0x00ba
  Serial Number:    0x008475d0
  Charging: No
I found this article 'About Mac notebook batteries' on Apple's website, click on the link to go to the article: About Mac notebook batteries

In the report you submitted (in the first block) I read this: 


  Condition: Replace Now


That's probably not good, and I think you'll have to replace the battery.