MV I need a script that makes some items restricted to certain classes

In the project that I'm doing there are human actors and robot actors. I was doing the healing items in the game and I noticed that it doesn't make much sense for a robot taking aspirins to heal itself, so I need a script that limits the consumption of items for certain classes, that allows me to block a actor or class "X" from consuming a item "Y"
Can someone please help me with this? I don't know anything about java script 🙁
theres yanfly item requirments.
but this i find only works good for self target items and attack items.
and only good for battle use items. not good for items can use from main menu.

if want human to be able to use a repair kit on robot character that plugins doesnt work so great.
so ally target items like this would use selection control so repair kit can only target someone with Machine state. (or could use javascript to target class)
<Custom Select Condition>
if (user.isClass($dataClasses[n])) {
condition = true;
} else {
condition = false;
}
</Custom Select Condition>

You will need Yanfly selection control

Replace n with the class number.
Put this inside an item's notetag box.
thanks Johnny and Tiamat for the tips, but I found another very good plugin that limits the use of items by classes, but different from the "selection control", it is free. in case anyone is interested in the plugin, it is called "class-items" (https://forums.rpgmakerweb.com/index.php?threads/class-items.50155/) and is very simple to use

Original thread: https://forums.rpgmakerweb.com/threads/i-need-a-script-that-makes-some-items-restricted-to-certain-classes.132272/