How can I prevent my phone from reaching full charge?

Sep 5, 2017
Lithium ion batteries lose charge capacity over time by being charged to 100%. Is there a way my phone can charge to like 90% and stop charging? Like an app or a piece of charging hardware?

My phone is the Oneplus 5, in case it matters.

Edit: Before anyone says so, I am already aware that I can unplug my phone before it fully charges.