Calculating a distance between player and event in the more diagonal friendly way

Greetings! So, i want to create an interesting effect that makes event darker when it is off screen, to create some kind of pop-up book effect. To do that i use this script.
Code:
$gameMap.distance($gamePlayer.x,$gamePlayer.y,$gameMap.event(this._eventId).x,$gameMap.event(this._eventId).y) > *distance*
It does it's job pretty well....
Spoiler
ezgif-7-0d4f1dc5cc.gif
...until you go somewhere that is not the same as X or Y event coordinate.
Spoiler
ezgif-7-0cb0603248.gif
From what i noticed it works like Visustella's activation circle, but i need it to work like activation square. Just to be clear i know almost NOTHING about javascript unfortunetly, which is why I am posting this.

600px-EventsMoveCoreActivationAreas.png
Are you sure a different distance calculation is what you want? Your game's resolution isn't a square, so the distance to the left edge is greater than to the upper edge.

If so, it's fairly simple to achieve:
JavaScript:
Math.max(Math.abs($gamePlayer.x - $gameMap.event(this._eventId).x), Math.abs($gamePlayer.y - $gameMap.event(this._eventId).y)) > *distance*
Edit: What I wrote earlier wouldn't work. haha. I'll make the changes below.

Mac's way works and is more efficient. Carry on.

Here is something that might work, though, a lot is going on:
JavaScript:
Math.floor(Math.hypot(
    $gameMap.deltaX($gamePlayer.x, this.character(0).x),
    $gameMap.deltaY($gamePlayer.y, this.character(0).y))) > 2

Original thread: https://forums.rpgmakerweb.com/threads/calculating-a-distance-between-player-and-event-in-the-more-diagonal-friendly-way.169323/