How can I check when a specific item is being used inside a common event?

I was wondering if there is a way to write a condition that checks if a specific item is being used.  

Being able to insert conditions onto the item itself inside the database (perhaps in the formula bar) might work as well.  I'm not sure if that's possible or how to go about doing it if it is.

What I'm trying to accomplish is for an item to add extra HP to the character when it's used if a switch = ON without having to write an individual common event for the item.  
for that specific situation, I would just put it in the damage formula.

I'm assuming you want to say something like "if switch is on then give 50 HP, otherwise just give 25 HP"

The damage formula would be:

$gameSwitches.value(id) ? 50 : 25
where id is the switch id
for that specific situation, I would just put it in the damage formula.

I'm assuming you want to say something like "if switch is on then give 50 HP, otherwise just give 25 HP"

The damage formula would be:

$gameSwitches.value(id) ? 50 : 25where id is the switch id
Thanks that's working perfectly for what I was wanting to do.

Is there a way to turn a switch off in the damage formula after the item adds the HP?
Yes, but it's a bit more complicated because the damage has to be the last thing.

Code:
dmg = $gameSwitches.value(id) ? 50 : 25; $gameSwitches.setValue(id, false); dmg
Yes, but it's a bit more complicated because the damage has to be the last thing.

dmg = $gameSwitches.value(id) ? 50 : 25; $gameSwitches.setValue(id, false); dmg
Thank you very much.  You just saved me from having to write an untold number of common events. 🙂

Original thread: https://forums.rpgmakerweb.com/threads/how-can-i-check-when-a-specific-item-is-being-used-inside-a-common-event.50311/