Using an item via script

I'm trying to have an item automatically be used when certain conditions are met. Is there a way to do this? I don't see any obvious answers anywhere. How to open the inventory via script isn't immediately apparent either. I'm still learning how to code though, so I figure I'm just missing something.
Instead of trying to use an item through code, just implement the effect that item will have through code.
What would that item do?
Yeah that was my initial idea, but then it kinda fell apart when used in battle. The problem is that the item calls a Common Event which opens a Choice Menu that then opens the Select Item command. I have the effects coded out, but there is no way to target the user of the initial item. It'd be easier if I could just make the initial item use the second item, which would let me select a target, as a potion would.
What would that item do that you select with the select item command?
Heal, apply buffs and remove debuffs. When out of battle, the item affects the whole party as intended, but in battle, I just want it to affect the user.

Original thread: https://forums.rpgmakerweb.com/threads/using-an-item-via-script.83382/