That isn't possible.
Any normal USB device needs power supply to communicate. Which basically means for any normal USB such as MicroUSB, a device can keep the USB interface turned off until 5V is detected from PC.
And then it can use the 5V supply. And if you try to limit it or turn it off, the device does not need to work without 5V supply as it must turn the interface off. Limiting it means it will drop or turn off when too much is consumed.
You likely want this because you have read somewhere that charging batteries to only 80% full will make them last longer.
That is true; however, you cannot know what capacity battery your phone really has by design and how much capacity the phone is made to use from it. It may very well be that when phone shows 100%, the battery is not really charged to full capacity.
The battery could likely hold some more charge but it is left as a margin to take into account how much the battery degrades and ages depending on how full it is charged, so the phone manufacturer has already done the difficult task of determining how much of the battery capacity will be used so it lasts long enough. Basically same as with EVs, whatever amount of capacity the batteries really have, only the specified amount of capacity is presented for the user as 0% and 100%, so that after the batteries have degraded due to years of use and charging/discharging cycles, the rated user visible capacity is still there.
Devices and their chargers are very smart and under software control, as even the charging system behaviour can be altered by software or firmware update.
I don't think you will have any benefit of trying to limit the charging to 80% yourself, as it basically means disconnecting USB supply and it means USB communication also stops.
So just let the phone to charge itself so that it presents 100% to you and stops charging, the battery is likely rated to handle it, and will continue to use USB power until you disconnect it.