frankv:
If you have a Wifi-enabled plug, you could have an app monitor the battery state and send a message to the plug to turn it off. Or similarly via BT. Maybe something similar via OTG, except I think OTG doesn't allow power supply IIRC. Or use a specific tone for the alert, and detect that in an external device that turns off the charger.
But these are all work-arounds for a deficiency in the OS. And of course phone manufacturers have no motivation to decrease the rate at which cellphones wear out.
Not a bad idea. Also quite easy to do with Home Assistant and plugs, since HA can monitor phone state of charge.