DoubleX RMMV Permanent States

Updates

Code:
 *      v1.02a(GMT 1400 1-12-2015):                                            *      1. <permanent state: type> has changed to                              *         <permanent state: scene, type>                                      *      2. Added new permanent state type recover restored upon recover all    *      3. The same state can now have more than 1 permanent state type        *      4. Removed param allStatesPermanent in the plugin manager              *      5. Fixed undefined permanent state containers upon loading savefiles
I'm afraid I'm having even more problems with this version than previous ones.

1. With the exception of <permanent state: battle, persist> and <permanent state: map, persist>, all of the other note tags make my entire game entirely unplayable. Just as I launch the play test of my game I get: "undefined is not a function".

2. The Death/KO state is broken again. This time my games breaks every time the death/KO state is implemented. I get the error message: "Cannot set property "length" of undefined".
Updates

Code:
 *      v1.02b(GMT 0800 2-12-2015):                                            *      1. Fixed reading repetitive notetag values due to typo bug             *      2. Fixed permanent state type persist not working due to typo bug      *      3. Fixed null permanent state container due to wrong init timing bug   *      4. Fixed undefined $gameParty upon actor initializations bug
Now ALL of the note tags make my game not work at all. But death/ko works fine now.
Now ALL of the note tags make my game not work at all. But death/ko works fine now.
May you please show all error messages for all cases completely? I think I'm still missing something entirely even though I've checked my codes several times 🙂
They all say "undefined is not a function". I've tried all of the note tags out individual and they all said the same thing.
They all say "undefined is not a function". I've tried all of the note tags out individual and they all said the same thing.
May you please open the console and take a screenshot on the whole error message? It should at least include the offending line number 🙂
Here is an attached screen shot of the error. I hope this helps.

Screen Shot 2015-12-03 at 6.01.43 PM.png
...
Updates

Code:
 *      v1.02c(GMT 0100 4-12-2015):                                            *      1. Fixed undefined all array function which should be empty instead    *      2. Increased this plugin's compactness, efficiency and robustness
Finally! The plugin actually works; at least as far as I could tell. But there is one minor problem. It's  significant problem though, but it's also minor. The death/KO state still remains after the "Recover All" event command is called, even though an actor's HP is still fully restored. However, when the player goes into battle, the death/ko state is removed and the problem is corrected. I don't have any note tags on the death/KO state. But I have a screen shot of an actor in the death/KO state that also has full HP. Ask stated before, going into battle will remove the state. 

Screen Shot 2015-12-03 at 11.59.39 PM.png
May you please try to place this diagnose snippet right below the plugin and open the console to see what's logged there when this issue happens?

Spoiler
Code:
(function(PS) {    PS.Game_BattlerBase.storePermanentStates = function() { // Rewrite        var sc;        if (!this._states || !this._stateTurns) { return; }        sc = PS.scene();        this.states().forEach(function(s) {            console.log("PS.Game_BattlerBase.storePermanentStates", sc, s.id, s.meta.permanentStates[sc]); // Added            s.meta.permanentStates[sc].forEach(function(t) {                this._permanentStates[sc][t].push(s.id);                this._permanentStateTurns[sc][t][s.id] = this._stateTurns[s.id];            }, this);        }, this);    }; // storePermanentStates    // type: The permanent state type    PS.Game_BattlerBase.restorePermanentStates = function(type) { // Rewrite        var sc;        if (!this._states || !this._stateTurns) { return; }        sc = PS.scene();        console.log("PS.Game_BattlerBase.restorePermanentStates", sc, type, this._permanentStates[sc][type], this._permanentStateTurns[sc][type]); // Added        this._states = this._states.concat(this._permanentStates[sc][type]);        this._permanentStates[sc][type].length = 0;        Object.keys(this._permanentStateTurns[sc][type]).forEach(function(id) {            id = +id;            this._stateTurns[id] = this._permanentStateTurns[sc][type][id];        }, this);        this._permanentStateTurns[sc][type] = {};    }; // restorePermanentStates})(DoubleX_RMMV.Permanent_States);
Does this console screen shot tell you anything?

Screen Shot 2015-12-06 at 6.15.07 PM.png
Guess what! I made a mistake! I accidentally put note tags in the death/KO state. That's why the death/KO state wasn't getting removed properly. I think the plugin works just fine now. Nothing is broken anymore. No more changes are needed. Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/doublex-rmmv-permanent-states.48650/