Yanfly Region Events - Checking if player is on a region

I'm trying to use Region Events as a way to have the player move diagonally across side stairs rather than use the parallel process method described here. I need a way to change the first if statement to check to see if the player is on the Region ID associated with the Common Event this code is found in. For example, if this code is written in Common Event 1 then it will run when player enters Region 1. It should be a simple change I just don't know how to do it. Thanks for the help!

Code:
if($gamePlayer._realX === $gameMap._events[this._eventId]._x && $gamePlayer._realY === $gameMap._events[this._eventId]._y){
  var dir = $gamePlayer._direction;
  if(Input.isPressed("up")||Input.isPressed("right")){
    $gamePlayer._through = true; $gamePlayer._direction = 6; $gamePlayer.moveDiagonally(6,8);
  }
  if(Input.isPressed("down")||Input.isPressed("left")){
    $gamePlayer._through = true; $gamePlayer._direction = 4; $gamePlayer.moveDiagonally(4,2);
  }
  $gamePlayer._through = false;
}
Might I suggest this as an alternative, it seems a bit easier than what you're trying to do:
https://forums.rpgmakerweb.com/index.php?threads/move-up-down-sideview-stairs.61269/

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-region-events-checking-if-player-is-on-a-region.96146/