Small Script to Return Used Item ID to Variable

Hello,

I know nothing about JS, but I was wondering if a script can be made to do something simple, or someone explain to me on how to do it.

Either way, I need something to do this:
When I use an item, any item it doesn't matter, it detects I used an item, then returns the item ID of the item that was just used and stores it in a selected variable. I need something like this due to a plugin not having any item notetags, so for me to manipulate factors of this plugin, I have to use a common event and plugin commands, but I don't want to have to use 100+ common events if I can just have 1 common event that checks what item was just used and then does the correct branch based off of that.

EDIT: I also need to know how to use the actor that the item was used on as the actor ID in a plugin command. E.G., if I used said item on actor 1, the plugin command would be HEALTH ADDHP 1 food 20 for example. If actor 2, then HEALTH ADDHP 2 food 20. I know it's something to the effect of this.ActorID() or something to that effect.
You can use the Select Item option in the event tabs.

Edit: Are you just trying to increase an actor's parameter through items?
I don't think that will help me for exactly what I need to do, but I am glad that's a command I can use. I have never noticed it before. Basically this is for food items for a survival type plugin, but this plugin doesn't have any item comment tags I can use. That's why I was needing it so when I use, say a Cooked Apple, which is Item ID 2, upon using this item it automatically sets that item ID to a variable. Select Item would work as a workaround if I had a permanent reusable item in the inventory that all it does is lets you select a food item and eat it that way, but that seems like a long workaround for a game.
Hello,

I know nothing about JS, but I was wondering if a script can be made to do something simple, or someone explain to me on how to do it.

Either way, I need something to do this:
When I use an item, any item it doesn't matter, it detects I used an item, then returns the item ID of the item that was just used and stores it in a selected variable. I need something like this due to a plugin not having any item notetags, so for me to manipulate factors of this plugin, I have to use a common event and plugin commands, but I don't want to have to use 100+ common events if I can just have 1 common event that checks what item was just used and then does the correct branch based off of that.

EDIT: I also need to know how to use the actor that the item was used on as the actor ID in a plugin command. E.G., if I used said item on actor 1, the plugin command would be HEALTH ADDHP 1 food 20 for example. If actor 2, then HEALTH ADDHP 2 food 20. I know it's something to the effect of this.ActorID() or something to that effect.

Hey bud, i made this plugin for ya. Install it and chance plugin's parameter to variables Id that you want, once you use an item,
item id & actor id will get stored automatically. Well, in exchange please credit me as master2015hp in your game = )

Original thread: https://forums.rpgmakerweb.com/threads/small-script-to-return-used-item-id-to-variable.103756/