There is nothing that firmware/software can do to make a battery lose capacity, only make it draw more or less current at any given time.
Capacity is defined by battery chemistry/size, and will degrade over time because of the efficiency of the chemical reactions, but absolutely can not be affected by code.
Well, sloppily designed firmware for charging the battery could speed up degradation. E.g., firmware tells the battery to charge for two minutes followed by a discharge for 30 seconds the entire time the notebook is plugged in. That could certainly degrade the battery. And while the issue itself could be fixed through software, the long-lasting hardware damage cannot.