Take a look at AllDente it’s awesome.
Li-ion and polymer batteries (like the one in your MacBook) last the longest when operated between 20% and 60%. Keeping your battery at 100% most of the time will significantly shorten the lifespan of your MacBooks battery and Replacing an old battery is not only harmful to the environment but also costs up to $ 199. With AlDente installed, you can set a charging limit in a more healthy charging range, and with more features like Sailing Mode or Heat Protection you can keep your battery healthy even longer.
I have no connection with that app or development or whatsoerver but I’m just a happy user.
Also check out this thread.