Use KM to Enable/Disable MacOS "Optimized battery charging"?

Hi,

Has anyone found a way to use KM (with an AppleScript I guess) to enable or disable MacOS "Optimized battery charging" feature?

I'd like to disable it during the day for more battery capacity but re-enable it at night to help my battery health.

Thanks!