Increasing variables when item is used on specific party member.

I'm attempting to create a system where "affection" increases when an item is used on a party member. I got the idea to have the item cause a common event that increases the affection variable whenever it's is used, but the problem is, the variable will increase even if the item is used on another party member.

Does anyone know of a clever way to implement this so it only affects the character it's used on?
you need to check which actor it is used on before increasing the variable.

one way to do this is have the item apply an invisible target state and then use conditional branch for checking which actor has the state and react before removing the state.
you need to check which actor it is used on before increasing the variable.

one way to do this is have the item apply an invisible target state and then use conditional branch for checking which actor has the state and react before removing the state.
That doesn't appear to be working for me. I've set the item to add the hidden state to the enemy as well as trigger a common event which checks that the user is in the party and if they have the state. if those are checked it adds the variable then removes the state. When I use the item from the menu it kicks me back to the game and no progress seems to occur. Am I missing something?


Edit: I figured it out. I have a separate event that triggers a conversation once the variable reaches a certain number, but a switch needs to be turned on for it to occur. I fixed it by turning the switch on at the start of the common event that plays when you use an item. The switch is then set to turn off.

Thank you. Your idea worked!

Original thread: https://forums.rpgmakerweb.com/threads/increasing-variables-when-item-is-used-on-specific-party-member.156249/