MV Replacing this._eventX & Y with a variable?

So I'm using a parallel event in which I'm running various bits of script to essentially make a system where my events can detect the distance between them and the player to determine what actions they do. The script I'm running is:

this._playerX = $gamePlayer.x;
this._playerY = $gamePlayer.y;
this._eventX = $gameMap.event(1001).x;
this._eventY = $gameMap.event(1001).y;

from there a conditional branch is ran with a script condition of:
$gameMap.distance(this._playerX,this._playerY,this._eventX,this._eventY) <= 1
to determine what happens with the event in question. My question is because my script understanding is still quite shallow how could I replace the this._eventX & Y instead with a variable so that this process could be run for multiple events at a time.
To read from a variable you use $gameVariables.value(1) and to write, you use $gameVariables.setValue(1, 2) (sets 2 to the Variable 1).

Your code would look like this:

Code:
...
this._eventX = $gameMap.event($gameVariables.value(1)).x;
this._eventY = $gameMap.event($gameVariables.value(1)).y;
there are plugins that read distance, simple, average, complex.

I have 1 in my base, to check the distance.
TSR_TransferTrigger can have a nice range trigger too,

in case you want to block view by obstacles, Gimmer_SpottingPlayers
is another nice one to set it up clean and effective.

MOG has one too, or search on sensors and you get a bunch
of nice plugins to use that is mostly far more effective that checks
multiple things.

scriptcall you use is more a simple form, mostly enough if there is only 1 -4 spots.
but TSR_TransferTrigger can have more uses than just a sensor 🙂

Original thread: https://forums.rpgmakerweb.com/threads/replacing-this-_eventx-y-with-a-variable.178134/