MV Replacing an item with another item on use (Galv's Actor Equip Items)

I'm trying to create an item that replaces itself with another item when used. The issue is that I don't know to target the user using script.
Code:
$gameActors.actor(1).equipActorItemSlot(-1,27,1,true);
The item triggers a common event with the code above when used but I need to replace $gameActors.actor(1) with code that targets the item user instead, but I haven't figured out how to do that.
$gameActors.actor($gameParty._targetActorId)
$gameActors.actor($gameParty._targetActorId)
Hey, sorry for taking so long to respond but that code doesn't seem to work. Are you sure it's meant for common events?
switch.png
That was for menu use, if you want battle, try something like BattleManager._subject.actorId()
That was for menu use
Ah, I should have been more specific. My mistake.
BattleManager._subject.actorId()
Unfortunately, this doesn't seem to work either.
Hmmm, I tested it and those seemed to work for me. Like they put an item in the "pockets" or whatever. Not sure what you're trying to achieve though.
Scratch that, it does work. I'm very new to programing and didn't realize it was supposed to be $gameActors.actor(BattleManager._subject.actorId())

Thanks for the help!

Original thread: https://forums.rpgmakerweb.com/threads/replacing-an-item-with-another-item-on-use-galvs-actor-equip-items.179848/