Common Events: Code?

I need help with something you may find obvious, but as I'm just starting, I have no idea how to google it or find it.


I want to know how to check who I'm using an item on.
I set the item to trigger a 'Common Event' on use.
But I don't know how to make the item check WHO I used the item on.
And I haven't found a way to find all 'commands' I can use on the common events, I find only the ones refering to specific actors... but I can't find a way to tell the program to tell me who I used the item on, to write the 'if/then'.
 


My simple goal is that, if the character I used the item on, is of a certain class (class ID 2), it'll work.
Else the item won't be used at all...


Any way to do this? Thanks beforehand.
that is one thing that needs a little workaround, because the default simply does not have that information.


the non-scripted workaround is having the item giving an invisible target state as an effect, and then in the common event use a series of conditional branches to check which actor has that state.


or you can use one of the scripts that will store this info into a variable and then check the variable - there are several advanced event scripts for this, one of them by Tsukihime and alternatives as well.
While searching for an answer, ended up using the formula area of the item to pass the character's ID to the Common Event. That was the solution~
Thanks!

Original thread: https://forums.rpgmakerweb.com/threads/common-events-code.66710/