MZ Actor Sprites disappearing instead of changing

So I've been playing RPG Maker MZ (My first RM) for around 4 days now, and I have the VisuMZ Plugins active. For at least the last 3 days I've been stuck because i want to change an actor's sprites when he activates a state. How it's supposed to work is: Thalassa (actor) uses a skill which grants him a state. This state works as a transformation that lasts 3 turns, then returns to normal and gives him a second state which doesn't allow him to use the transformation again in X amount of turns (This is also not working because even thought I place the ID, it gives him a different state from the one I wrote). When I test it, instead of switching the sprites as stated in the code, his battler image disappears and his face image doesn't change. After the state wears off everything returns to normal so at least that part works. I've been searching through the internet how to fix this but I've hit a brick wall.

This is the code I have on the state:

Code:
<JS On Add State>
if (user.isActor()) {
  user._prevCharName = user._prevCharName || user._characterName;
  user._prevCharIndex = user._prevCharIndex || user._characterIndex;
  user._prevFaceName = user._prevFaceName || user._faceName;
  user._prevFaceIndex = user._prevFaceIndex || user._faceIndex;
  user._prevBattlerName = user._prevBattlerName || user._battlerName;
  if (user.actorId() === 0010) {
    var charName = 'Thalassa';
    var charIndex = 1;
    var faceName = 'Thalassa';
    var faceIndex = 5;
    var battlerName = 'Thalassa2';
  }
  actor.setCharacterImage(charName, charIndex);
  actor.setFaceImage(faceName, faceIndex);
  actor.setBattlerImage(battlerName);
  actor.refresh();
}
</JS On Add State>

<JS On Expire State>
var charName = user._prevCharName;
var charIndex = user._prevCharIndex;
var faceName = user._prevFaceName;
var faceIndex = user._prevFaceIndex;
var battlerName = user._prevBattlerName;
user.setCharacterImage(charName, charIndex);
user.setFaceImage(faceName, faceIndex);
user.setBattlerImage(battlerName);
user._priorityCharacterName = undefined;
user._priorityCharacterIndex = undefined;
user._prevFaceName = undefined;
user._prevFaceIndex = undefined;
user._priorityFaceName = undefined;
user._priorityFaceIndex = undefined;
user._prevFaceName = undefined;
user._prevFaceIndex = undefined;
user._priorityBattlerName = undefined;
user._prevBattlerName = undefined;
user.addState(0034)
</JS On Expire State>

P.S. I have NO knowledge of coding in any way. What I've written I've found in different sites ^^;
For the graphic issue, no idea really, but for the IDs I suggest not using zeroes at the start, just using
user.addState(34) should work fine. Leaving the zeroes makes it sometimes interpret the number in weird ways, at least in some coding languages. Dunno about JS.

We could however debug something, if you want.

As a test, after this line...
Code:
user._prevBattlerName = user._prevBattlerName || user._battlerName;
Put this other line, it prints the prevBattlerName to the console.
Code:
console.log(user._prevBattlerName)
Then open the console with F12, and look at what it outputs.

I have a hunch that maybe it has something to do with the graphic names, at least for the battler graphic. The face will probably need to be changed in another way since it doesn't seem to be affected.
I play tested with that edit and got this error
Code:
ReferenceError: actor is not defined
    at Game_Actor.eval (eval at Scene_Boot.<computed>.<computed> (VisuMZ_1_SkillsStatesCore.js:1), <anonymous>:25:3)
    at Game_Actor.Game_Battler.<computed>.<computed> [as onAddStateCustomJS] (VisuMZ_1_SkillsStatesCore.js:2040)
    at Game_Actor.Game_Battler.<computed>.<computed> [as onAddState] (VisuMZ_1_SkillsStatesCore.js:2040)
    at Game_Actor.Game_Battler.<computed>.<computed> [as addState] (VisuMZ_1_SkillsStatesCore.js:2040)
    at Game_Action.itemEffectAddNormalState (rmmz_objects.js:2144)
    at Game_Action.<computed>.<computed> [as itemEffectAddNormalState] (VisuMZ_1_BattleCore.js:9457)
    at Game_Action.itemEffectAddState (rmmz_objects.js:2120)
    at Game_Action.applyItemEffect (rmmz_objects.js:2052)
    at Game_Action.apply (rmmz_objects.js:1910)
    at Game_Action.<computed> [as apply] (VisuMZ_1_BattleCore.js:9457)

Original thread: https://forums.rpgmakerweb.com/threads/actor-sprites-disappearing-instead-of-changing.127356/