stop charging while plugged in

Is it possible to change the internal operating system of apple's charging methods? So if I want to make an app or some code to make a MacBook stop charging at a certain percentage while it's still plugged in and then let the battery drain until 20%, it automatically starts charging again to 80%. All while it's plugged in.

Does apple allow this? to make something like this?

I want to make an app or some code to make a MacBook stop charging at a certain percentage while it's still plugged in

The macOS SDK has no APIs to do anything like this.

Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

@Rubenscores It is abetter design not to have it. An app could badly interfere with other apps which need to have more power… Or even force battery to completely discharge.