Changing class through item and common event script [SOLVED]

(Apologies, I'm new here. This is a repost since I accidentally started a thread in VX Ace intending to get help with MV)

I've run into a snag where my character's class doesn't update when consuming an item tied to a class changing event. This has to be accomplished through scripting since I want to avoid messy if statements.

The code I'm trying to run is simple:
$gameParty.targetActor.changeClass(3, false);

I've tried using a similar method using an item, but that doesnt work either:
$gameParty.actor(1).changeClass(3, false)

I don't know what direction to troubleshoot. The item only affects the user, and I've called a separate non-script action through the same event without problems. If anyone could help, it'd be greatly appreciated.
Have you tried doing

$gameParty.actor(1).refresh()

after that?

Edit: Wait, hold up. targetActor and actor() aren't a thing in $gameParty, where did you get the idea that they are? It'd be $gameParty.members()[id].changeClass(3, false)
I'll try that in a bit, thanks.
Edit: Wait, hold up. targetActor and actor() aren't a thing in $gameParty, where did you get the idea that they are? It'd be $gameParty.members()[id].changeClass(3, false)
I based my script after this MV documentation project and this list of example methods that stated those were methods of $gameParty.

EDIT: This still doesn't work.
I'll try that in a bit, thanks.

I based my script after this MV documentation project and this list of example methods that stated those were methods of $gameParty.
Have you maybe gotten $gameParty and $gameActors confused? $gameActors has an actor function.

$gameParty does have a targetActor function as it turns out so that one should work, but you need the parentheses after it to call it as a function.
Thank you so much! This is exactly what I needed 😀
$gameParty does have a targetActor function as it turns out so that one should work, but you need the parentheses after it to call it as a function.

Original thread: https://forums.rpgmakerweb.com/threads/changing-class-through-item-and-common-event-script-solved.138353/