Help Fixing This Script Set Up?

I was following these images (in order here, here, here, and here) that Zarsla suggested for my Fire Emblem Class Change System, but I keep getting "Script Call Error" and "actorId is not defined"/"actorIds is not defined" errors in the developer console. Can someone please help me fix this? I wrote everything down exactly as it says (I have literally no JS knowledge).

If it helps, plugins in use are Yanfly Core Engine, Yanfly Item Core, Yanfly Item Requirements, Yanfly Skill Core, HIME Large Choices, HIME Hide Choices, and DreamX Choice Help
Did you remove any actors from your starting party? Did you do it by deleting actors on the Actors tab, or by deleting them from the Party list on the System tab?

Did you start a new game after adding the plugins, or did you load a game you'd saved earlier?
@Shaz No, no, and I always start from new game whenever I playtest.
Please show screenshots from the console so we can see the full error message and what plugin is generating it. Also screenshots from your plugin manager (have you confirmed that your plugins are all in the right order?)
@Shaz
DevLog.png
Plugins.png
Do you have links to the various plugins (preferably not the plugin itself, but any threads/blogs that talk about them and include the links)?
@Shaz You mean where I got them?
yep - particularly the hide choice & weapon unleash plugins.

I suspect the issue is the way you have the hide choices set up to use a local variable.

Try replacing $gameActors.actor(actorId) with $gameActors.actor($gameVariables.value(11))
Yes, the issue is one of scope: the hide_choice eval is performed privately and cannot "see" the actorId variable defined on the previous line of the script call.

I also noticed you've missed a condition for choice #4, is that intentional? 😅
@Shaz
HIME_HiddenChoices- https://forums.rpgmakerweb.com/index.php?threads/hidden-choice-conditions.49380/
Yanfly Weapon Unleash- http://yanfly.moe/2015/12/26/yep-51-weapon-unleash/

@caethyril Whoops, knew I messed up somewhere- forgot 4 and moved on to 5.

EDIT: I did as Shaz said but now I get these errors instead...
DevLog2.png
Basically, it means your actor doesn't exist.
Does the value in your variable 11 correspond to an existing actor id ?
@TWings This is what item does before calling the common event containing the error:
Code:
<Custom Enable Requirement>
condition = battler.level >= 10 &&
!$gameSwitches.value(4);
</Custom Enable Requirement>
<Before Eval>
var actorId = user.actorId();
$gameVariables.value(11, actorId);
</Before Eval>
Try $gameVariables.setValue(11, actorId); instead of $gameVariables.value(11, actorId);
My thoughts exactly.

In fact you could shorten that
Code:
<Before Eval>
var actorId = user.actorId();
$gameVariables.value(11, actorId);
</Before Eval>

to this
Code:
<Before Eval>
$gameVariables.setValue(11, user.actorId());
</Before Eval>

You would also need to make sure that can only be used by actors and not enemies, as enemies don't have an actorId so you'd get an error there too.
@TWings @Shaz Will try that when I get back on tomorrow.

EDIT: the 11 is supposed to be variable #11, not actor #11.

EDIT 2: It worked, but now a new problem occurs- after the item changes the character's class, it makes it where the same item can't be used to change the class of anyone else (it plays the buzzer sound).

EDIT 3: When I use it to change someone else's class in a different new game, it only changes the class of actor 1, just like my original problem with Yanfly's Class Core Change problem, which is the whole reason I resorted to this in the first place.

Original thread: https://forums.rpgmakerweb.com/threads/help-fixing-this-script-set-up.95636/