Force USB C MacBook to run off AC power
No.  You can’t do this.

In fact the Mac, if needed, runs off both battery and AC (mains) to extract the most amount of performance from the machine.

This is all handled by the SMC and there’s nothing in the OS that gives you access to any of it.  In fact, not only is there no software access, you can’t even get the technical specifications of the chip itself from Texas Instruments (TI) nor can you purchase it from electronic suppliers - it’s “locked down” by Apple.

As for the battery issue, it’s been asked/answered several times already:


Battery Full Alert
Should I disconnect my MacBook Pro&#39;s power cord when the battery is fully charged?
Battery - Shut down or sleep an MBP
How to preserve MacbookPro battery from degradation?


The link you supplied from Battery University is about storing batteries not using them.  It’s not realistic or practical to keep batteries charged at that 40% level because you’d be tethered to a power outlet all the time.

So, as I’ve said many times before, since the main factors that govern the lifespan of your battery are cycles and age, use your MacBook for what you bought it for and stop worrying about micromanaging the charging process.