I already know how to code in JavaScript, I thought this forum was for people who didn't know JavaScript...
I have to correct you, you learned the basics of javascript.
What you are trying to do is object oriented programming, but you clearly have no idea how it works. I don't mean to mock you though, everyone begins in the same place and I made the same mistakes when I begun.
First of all, you have mashed up a couple of things together without knowing what it is about.
Code:
function DeStatus() {
this.initialize.apply(this, arguments);
}
(function() {
var _DeStatus_test = DeStatus.prototype.test;
DeStatus.prototype.test = function() {
console.log("Here we are...");
_DeStatus_test.call(this);
};
})();
The first one is useful only when you have an object you can point it to (for example when DeStatus is a child object of Scene_Menu, it will gain all arguments Scene_Menu has. Since it's not a child of anything, it doesn't receive any arguments and initialize.apply is therefore completely pointless.
Next you used an anonymous function.
(function () {
code}
is an anonymous function that will automatically call itself. There's no need to trigger it.
Next you said you tried to call the function through
$DeStatus.test()
DeStatus.test()
But neither of these is bound to work.
$gameParty, $gameVariables, etc. work only because they have been explicitely defined. To be concrete they have been constructed in rpg_managers. In fact you can find this function
Code:
DataManager.createGameObjects = function() {
$gameTemp = new Game_Temp();
$gameSystem = new Game_System();
$gameScreen = new Game_Screen();
$gameTimer = new Game_Timer();
$gameMessage = new Game_Message();
$gameSwitches = new Game_Switches();
$gameVariables = new Game_Variables();
$gameSelfSwitches = new Game_SelfSwitches();
$gameActors = new Game_Actors();
$gameParty = new Game_Party();
$gameTroop = new Game_Troop();
$gameMap = new Game_Map();
$gamePlayer = new Game_Player();
};
and the word new is very important, because that means they are not aliasing, but they are constructed.
And the fact that they are constructed is very important, because it gives them access to prototype functions without the need to use the word "prototype".
So unless you define a constructor for your function and then construct $deStatus,it will simply not work.
And DeStatus.test () will not work, because test is not a method of DeStatus, but its' prototype function, so to call it you have to use DeStatus.prototype.test () to call this function.
I suggest you go study some object oriented programming before you begin making your own plugins.