Wait function in script counts down immediately to 0

Hey forum,

I simply want to make a script, where the name of the game map appears after x amount of time (frames) passes.
I copied some stuff from the Window_Message class, however, the _waitCount value goes directly to 0.
How do I tell MV to wait x amount of frames?

What am I missing here?

JavaScript:
function Window_MapLocation () {
    this.initialize.apply(this, arguments);
}

Window_MapLocation.prototype = Object.create(Window_Base.prototype);
Window_MapLocation.prototype.constructor = Window_MapLocation;

Window_MapLocation.prototype.initialize = function (x ,y , width, height) {
    Window_Base.prototype.initialize.call(this, x, y, width, height);
    this._waitCount = 0;
    this.startWait(100);
    this.drawLocation();
};

Window_MapLocation.prototype.drawLocation = function (){
    var n = $gameMap._mapId;
  
    if (this.updateWait() === true) {
        return this.updateText();
    } else {
    this.drawText("LOCATION // ",0,0,this.width,"left");
    this.changeTextColor(mainColor1);
    this.drawText($dataMapInfos[n].location,105,0,this.width,"left");
    this.resetTextColor();
    this.drawText($dataMap.displayName,105,25,this.width,"left");
    }
  
};

Window_MapLocation.prototype.updateText = function() {
    this.updateWait();
    this.drawLocation();
};

Window_MapLocation.prototype.updateWait = function() {
    if (this._waitCount > 0) {
        this._waitCount--;
        return true;
    } else {
        return false;
    }
};

Window_MapLocation.prototype.startWait = function(count) {
    this._waitCount = count;
};

Thanks for help!
if you you want to wait 100 frames before the name appear, what not draw
the map location wait(100) than draw text? instead of startcount - wait count?

do you want to use the inbuilt draw function? because there are some plugins out,
that alter the map name functions,

while you have the waitcount = 0, it doesn't really count down. you might need a wait
for countdown like startcount -= countdown (if its on 1) but im not that advanced on
JS, but I try to learn more so I can create better plugins and improve/add more functions
to the one I currently have.
if you you want to wait 100 frames before the name appear, what not draw
the map location wait(100) than draw text? instead of startcount - wait count?

do you want to use the inbuilt draw function? because there are some plugins out,
that alter the map name functions,

while you have the waitcount = 0, it doesn't really count down. you might need a wait
for countdown like startcount -= countdown (if its on 1) but im not that advanced on
JS, but I try to learn more so I can create better plugins and improve/add more functions
to the one I currently have.

What exactly do you mean by drawing the map location wait(100)? Is that a method from the game interpreter or how would I call this wait function?

I created my own draw function, because my map name has more details. I just want the game to wait one or two seconds before displaying the map name within the menu.
there is a command that exist like " this.wait(x); " x being the framerate.
while I dont know how your functions exacly work, but also dont know if you can
use wait first, than draw the text.

I try to help with the suggestion and knowledge I have at this point, I cant give you the
code how to do it correctly (I would if I know) but I didn't use that function though.

while it works as a scriptcall, it's also the same as the wait in the editor, but
you can exeed the 999 waitframes.
you can also wait for someone to pass the code how to achieve it.
while there are more 1 way to achieve the same thing, I hope you manage to get
it to work.
If i use this.wait(x) I get an error message "this.wait is not a function"
It has to be defined somewhere.

Thanks, I'm sure the solution is simple, I just don't see it.

Original thread: https://forums.rpgmakerweb.com/threads/wait-function-in-script-counts-down-immediately-to-0.121980/