MV How to set an actor or party member to a specific level

I'm using DreamX's [Capture Enemies] plugin and I would like to make it that if the player has already captured a specific creature and then captures that type of creature again I'd like to give the player the impression that the previous creature is replaced by the newly captured one. For my needs all that's really important is to change the creature's actor level. I have the new creature's level and I have the corresponding actor object.
JavaScript:
DreamX.CaptureEnemy.levelUpDuplicateActors = function (actorId, target) {
        for (var i = 0; i < $gameParty.allMembers().length; i++) {
            var actor = $gameParty.allMembers()[i];
            if (actor.actorId() === actorId || actor.baseActorId() === actorId) {
                //var newExp = actor.currentExp() + actor.nextRequiredExp();
                //actor.changeExp(newExp, paramDefaultLevelUpMsg);
                actor._level = target.level; // OpenTangent attempt 1
                actor.change_level(target.level, false); // OpenTangent attempt 2
            }
        }
    };
DreamX's code simply increments the level of the existing captured creature by 1 regardless of the target creatures stats so I've commented out that code. I made two attempts at explicitly setting the actor's level. Attempt 1 seems to work but then the game almost immediately sets the level back to what is was before. Attempt 2 throws an exception saying "change_level is not a function". Would I need to calculate experience and use actor.changeExp()? If so how would I do that? Any help is greatly appreciated.
Trying using actor.changeLevel(target.level, false) in your attempt 2 instead of change_level (and delete attempt 1).

You can look up the change level script call here: https://forums.rpgmakerweb.com/index.php?threads/rpg-maker-mv-script-call-list.46456/
I can't thank you enough @SeaPhoenix that worked perfectly. And thanks for the link to the Script Call List, that's going to make my life a lot easier.

Here's the final levelUpDuplicateActors function code. If the level of the enemy is higher than the existing capture's level then it changes it to that level, otherwise it just increases by 1.
JavaScript:
DreamX.CaptureEnemy.levelUpDuplicateActors = function (actorId, target) {
        console.log(target);
        for (var i = 0; i < $gameParty.allMembers().length; i++) {
            var actor = $gameParty.allMembers()[i];
            if (actor.actorId() === actorId || actor.baseActorId() === actorId) {
                if (actor._level < target.level) {
                    actor.changeLevel(target.level, false);
                } else {
                    var newExp = actor.currentExp() + actor.nextRequiredExp();
                    actor.changeExp(newExp, paramDefaultLevelUpMsg);
                }
            }
        }
    };

Original thread: https://forums.rpgmakerweb.com/threads/how-to-set-an-actor-or-party-member-to-a-specific-level.127730/