If you would like to use eventing, it would be really easy to set up actually.. Use a class specific item, and a conditional branch.
Example: Aluxes is a fighter; assign him an item called "fighter token". Make a common event, that contains the skill to learn in a conditional branch, and have the conditional branch check to see if item "fighter token" is in inventory. If yes, consume one of those potions, and learn the skill. If not, display text "your characters class cannot use that potion", or yanno, whatever you want it to say...
The only downside to this, is that you cannot allow the player to change their class, or if they do, that you remove the token and assign a new one (like "wizard token" or whatever you have for classes), that way your potions will seem to be dynamically reacting to the player. You should also keep in mind that this will only work to read the token in your main characters inventory, not your other party members. If you want to make this work for other characters too, you would need to use variables, one for each character, and you would need to ask one of the great scripters here, how to go about using a script call to assign a numerical value to each variable, based on each characters class. So for instance, if actor 1 is a fighter class, assign variable 51=1. If they're a cleric 51=2, and so on. Then use a common event to ask which character wants to use the potion on, y cycling through "if" branches. Within each branch, have the event check the variable values, and if the value matches the required class for the potion, use the potion, and if not, tell them the character can not use the potion.
A quick mock-up of it is below... It should look something like that when you're done... Hope this all helps you out!!
::fighter potion
Would you like $actor1 to use the potion?
If Yes > is $actor1 a fighter? (script call should be somewhere right here to check this)
If Yes > PotionX -1
>GoTo labelEND
If No > Text: This character cannot use this potion
> GoTo labelEnd
If No >
Would you like $actor2 to use the potion?
If Yes > is $actor2 a fighter? (script call should be somewhere right here to check this)
If Yes > PotionX -1
>GoTo labelEND
If No > Text: This character cannot use this potion
> GoTo labelEnd
If No >
Would you like $actor3 to use the potion?
If Yes > is $actor3 a fighter? (script call should be somewhere right here to check this)
If Yes > PotionX -1
>GoTo labelEND
If No > Text: This character cannot use this potion
> GoTo labelEnd
If No >
:labelEND