Custom game object problem

Hi people!
I'm making one of my free plugins and I have a problem with a custom game object that I'm making to be stored in the save file. But, I'm using the ES6 syntax to write the class.

When I start a game, everything works fine.
When I save the game too.
But after I load a game, it only recognizes the objects inside him, but not the functions of the class(return undefined).

But, if I change the syntax to ES5(like rm mv use) everything works fine.
The case is that I really want to use ES6 syntax 😢

Here is a screenshot of the situation in the console:
Spoiler: console
YjJc6IN.png

And here is the code in case anyone wants to test it:
master.js
pupil.js

And here is the code, in case you don't want to download:
Spoiler: master.js
JavaScript:
//==============================================================\\
//                          ES6                                \\
//==============================================================\\

class Game_Eli{
    constructor (){
        this.initialize();
    };

    initialize(){
        this.setObj();

    };

    setObj(){ // To be overwrited by plugin 2

    };

};

//==============================================================\\
//                          ES5                                 \\
//==============================================================\\

// function Game_Eli() {
//     this.initialize.apply(this, arguments);
// }

// Game_Eli.prototype.initialize = function(){
//     this.setObj();
// };

// Game_Eli.prototype.setObj = function(){ // To be overwrited by plugin 2
  
// };


//==============================================================\\
//                      DATA MANAGER                            \\
//==============================================================\\

var $gameEli = null;

var DataManager_createGameObjects = DataManager.createGameObjects;
DataManager.createGameObjects = function() {
    DataManager_createGameObjects.call(this);
    $gameEli = new Game_Eli();
};

var DataManager_makeSaveContents = DataManager.makeSaveContents;
DataManager.makeSaveContents = function() {
    let alias = DataManager_makeSaveContents.call(this);
    alias.eli = $gameEli;
    return alias;
};

var DataManager_extractSaveContents = DataManager.extractSaveContents;
DataManager.extractSaveContents = function(contents) {
    DataManager_extractSaveContents.call(this, contents);
    $gameEli = contents.eli;
};
Spoiler: pupil.js
JavaScript:
Game_Eli.prototype.setObj = function (){
    this._book = "Amazing!"
};

Game_Eli.prototype.getObj = function(){
    return this._book;
};


What I'm missing?
I'm thinking that maybe it has to do with a load function in DataManager, but I've searched and can't find a clue.
Also, I'm taking a look at this, in case it is a javascript error and not a "don't understand the mv code properly".
Still, I can't find the light =/
Hi people!
I'm making one of my free plugins and I have a problem with a custom game object that I'm making to be stored in the save file.
...
Spoiler
Code:
/*=============================================================================*\
* CTB SaveDataEx
* By CT_Bolt
* CTB_SaveDataEx.js
* Version: 0.10
* Terms of Use:
*  Free for commercial or non-commercial use
*
/*=============================================================================*/

/*:
* @plugindesc v0.10 CT_Bolt's Save DataEx Plugin
* @author CT_Bolt
*
* @help
* CT_Bolt's Save Data Extended
* Version 0.10
* CT_Bolt
*
* ***************** Description **********************
*
* ****************************************************
*
* History Log:
*  α v0.10 Alpha Release   (04/26/2020)
*
*/
//=============================================================================
//=============================================================================

var CTB = CTB || {}; CTB.SaveDataEx  = CTB.SaveDataEx || {};
var Imported = Imported || {}; Imported["CT_Bolt SaveDataEx"] = 0.10;
//=============================================================================//

function Game_CTB_DataEx() {this.initialize.apply(this, arguments);}
Game_CTB_DataEx.prototype.initialize = function()     {this._names = ['simpson','homer'];};
Game_CTB_DataEx.prototype.getName    = function(i)    {i = i || 0; return this._names[i];};
Game_CTB_DataEx.prototype.setName    = function(n, i) {i = i || 0;  this._names[i] = n;};
Game_CTB_DataEx.prototype.allNames   = function()       {this._allNames = ''; this._names.forEach(function(v){this._allNames = this._allNames + v + ", "}, this); return this._allNames.substr(0, this._allNames.length-2);};
Game_CTB_DataEx.prototype.names      = function()       {return this._names;};
Object.defineProperty(Game_CTB_DataEx.prototype, 'names', {
    get: function()      {return this._names        ;},
    set: function(value) {       this._names = value;},
    configurable: true
});

"use strict";
var $gameCTB = null;
(function ($_$) {
    $_$['DataManager.createGameObjects'] = DataManager.createGameObjects;
    DataManager.createGameObjects = function() {
        $_$['DataManager.createGameObjects'].apply(this, arguments);
        $gameCTB = new Game_CTB_DataEx();
    };
  
    $_$['DataManager.makeSavefileInfo'] = DataManager.makeSavefileInfo;
    DataManager.makeSavefileInfo = function() {
        var info = $_$['DataManager.makeSavefileInfo'].apply(this, arguments);
        info.names = $gameCTB.names;
        return info;
    };

    $_$['DataManager.makeSaveContents'] = DataManager.makeSaveContents;
    DataManager.makeSaveContents = function() {
        var contents = $_$['DataManager.makeSaveContents'].apply(this, arguments);
        contents.gameCTB = $gameCTB;
        return contents;
    };

    $_$['DataManager.extractSaveContents'] = DataManager.extractSaveContents;
    DataManager.extractSaveContents = function(contents) {
        $_$['DataManager.extractSaveContents'].apply(this, arguments);
        $gameCTB = contents.gameCTB;
    };
})(CTB.SaveDataEx, this);
That help?
Updated the first post.
Spoiler: Old
I forgot to add that, already put it in the code and in the first post:

Spoiler: master.js
JavaScript:
var $gameEli = null;

Eli.Book.DataManager_createGameObjects = DataManager.createGameObjects;
DataManager.createGameObjects = function() {
    Eli.Book.DataManager_createGameObjects.call(this);
    $gameEli = new Game_Eli();
};
Eli.Book.DataManager_makeSaveContents = DataManager.makeSaveContents;
DataManager.makeSaveContents = function() {
    let alias = Eli.Book.DataManager_makeSaveContents.call(this);
    alias.eli = $gameEli;
    return alias;
};
Eli.Book.DataManager_extractSaveContents = DataManager.extractSaveContents;
DataManager.extractSaveContents = function(contents) {
    Eli.Book.DataManager_extractSaveContents.call(this, contents);
    $gameEli = contents.eli;
};

@ct_bolt
Hm... I don't know, I will try to replicate this in my plugin and see if it works.
But I already have aliased and added into my plugin the following functions:
DataManager.createGameObjects
DataManager.makeSaveContents
DataManager.extractSaveContents


The only one that yours have and mine don't is this:
DataManager.makeSavefileInfo
I think this one is not the case since it's function is to put into the save scene some information.
I will check it tomorrow anyway. Thanks!


[EDIT]
It seems that I'm doing something wrong when try to use the es6 syntax to declare the class...
I try to do it in the same way rm mv code does, and it works perfectly:
JavaScript:
function Game_Eli() {
    this.initialize.apply(this, arguments);
}

Game_Eli.prototype.initialize = function(){
    this.helpWindows();
};

Game_Eli.prototype.helpWindows = function(){
    this.helpWindows();
};

But I would still want to do it in the es6 syntax =/

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/custom-game-object-problem.120642/