Sorry for the double post
@Mando Jetii I had some hard time with your problem. To change a variable during the action sequence, you have to do :
EVAL: $gameVariables.setValue(3,target.actorId());
This way, your variable 3 is going to be the target id.
The problem is, you want to use your item outside battle, which complicate things. The action sequence <Whole Action> or <Target Action> can only be used during battle. So event if you have the code:
Spoiler
<Whole Action>
EVAL: $gameVariables.setValue(3,target.actorId());
Change Variable 4 = 100
Perform Action
</Whole Action>
Your item is going to work perfectly during a battle (I tested it), but if you use it outside battle, nothing happend.
I was able to workaround the problem by adding a temporary state, because states work outside battles. You will need the yanfly Buff and States core. Creat a temporary state and use the fallowing notes on your temporary state:
Spoiler
<Custom Apply Effect>
//The value of variable 3 will be target's ID
$gameVariables.setValue(3,target.actorId());
//The value of variable 4 will be 100
$gameVariables.setValue(4,100);
//Play the common event (my is number 6)
$gameTemp.reserveCommonEvent(6);
//Remove the temporary state to leave your battler clean (my state's ID is 28)
target.removeState(28);
</Custom Apply Effect>
Then remove your notes on your item, because it can't work in your case, and just add this state as the effect. The state, while it apply on the battler, will change the variables, play the event and then auto-remove himself.
I hope this will solve your problem.