BatFi gives you full control over how your Mac laptop is charged
You can use System Settings -> Battery -> Battery Health -> Info Icon to toggle this “ML” approach where macOS (and the developers who know more than you about how to care for your Mac) will handle this for you but I’ve never gotten it to work as expected despite docking my laptop repeatedly, and for half the day, over a year.
You can buy it on Gumroad or here’s a download link.