How to add a variable to an item?

Hello everyone,
I'm looking to create an item holding system similar to the one in OneShot. I'll try to explain everything in detail below, so please excuse the long text.

You open the menu, select the item, and then interacting with map elements can trigger a switch.

The simplest example would be holding a key to open a door. It's not enough to have the key in your inventory; you need to be holding it. I could do this by equipping the item as if it were a weapon, but I'd like something faster than opening multiple windows to actually equip or unequip the item.

I managed to achieve what I want, but by creating a common event for each item (to assign a value to the variable). I'd like to know if there's a way to add a variable in a simpler way or even create a condition identifying the item by its ID.

The images are not in English, but I think you can understand. It's a really simple system.
Spoiler: pictures
1755883356628.png
1755883373450.png
1755883388960.png
Easiest way is to bind common event to some key (Q or W?) that opens a "select item" window and assigns item id to the variable. Then you can check the variable somewhere where item should be used. This way you just "skip" the inventory screen to use item, just have another button to "equip" items.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-add-a-variable-to-an-item.179711/