I'm on macOS 15.0.1 and it's built-in. See Battery -> Battery Health in System Preferences, then click the (i) on the status display. It will show a dialog with an option for "Optimized Battery Charging" that charges to 80%.<p>The option may also have been in earlier versions, I don't recall.