Changing class through item and common event script

I've run into a snag trying to get a consumable item to trigger a class change. So far, I've attempted to get class changing to work by running a script in a common event I've tied to that item:

$gameParty.targetActor.changeClass(3, false);

I'm not sure where I've gone wrong. The item target is the user, it can't be used in battle, the player's starting class isn't the same as the starting class. I don't know what's wrong (let alone if there's an output window lol)

The reason I used this method FYI is so any character is affected w/out messy conditional statements everywhere.
Oh dear, I posted in the wrong category. I'm on mobile! This was meant to go in MV D:
which maker are you using?
because you posted in VXA, but VXA has no method to store the target actor in default, that was only introduced in later makers and will NOT work in VXA.

To determine the target of an item in a common event called by it you either need a full script that creates such a method, or use the state and condition for state list.
As Andar said, you need to create a dummy status, have your item apply the status first before calling the CE:
Screenshot (5092).png

Then run your CE, and use conditionals for your characters:
Screenshot (5093).png

I've moved this thread to MV Support. Thank you.

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