I've made an inventory system that's going nicely, except for when it comes to actually using the items in the list.

Say I wanted to use a potion on 1 of 3 characters( 1 of 6 characters actually -- 1 character is the "leader" and the other 2 slots are taken by 2 of the other 5 characters the player chooses). How would I make it so that A character's HP would be replenished but it would not exceed his Maximum HP?

If I can figure this out I should be able to work everything else out.