Jumping slimes and collision

So in my game i have a switch that is triggered when an event touch the player, who loses a life and is knocked back.
It works (sort of) well but I have a problem with jumping enemies.

If a slime or whatever jump and it lands directly on the tile where the player actor is the switch is not triggered (switch is called in a event touch event). How can I solve this?

I was thinking about creating a loop that checks continuously on player coordinates and compare it with the coordinates of the enemy when it lands but I am not sure how to implement it. Maybe putting the loop that store the player coordinates as a separate parallel event and compare it in the enemy event after each jump. What do you think? It seems a bit convoluted and I am still quite new to rpgmaker so I want to avoid writing spaghetti code. Any tips/ ideas?
But what do you want to achieve by this? Enemy is jumping on you to attack you? "Event touch" doesnt work, because the event is on evvent, and the slime is "same as character" I think.
Set the event to parallel, then add an if statement checking for...
JavaScript:
Math.floor($gameMap.distance($gamePlayer.x, $gamePlayer.y, $gameMap.event(this._eventId).x, $gameMap.event(this._eventId).y)) === 0;

You can change the 0 to whatever distance you want to check for.
@fizzly, I am not sure what you mean. Anyway yes, the slime jumps around the map trying to hit you.

@ImaginaryVillain I'll give it a try!

Thanks for helping guys!
I could not get my head around the script so I ended up solving it like this. I'll post it here in case it could be useful for fellow javascript-impaired like me

Spoiler: picture
slimechecker.PNG
slimetest is the name of the slime event jumping around to kill you.
The deleted lines are not relevant to the behaviour.
The yellow wait instead is really important to time the triggering of the hit switch with the animation and it should be adjusted accordingly.
The jumpcheck switch is turned on inside the custom route of the slime.

edit: you can have a single event checking for all the slimes, as long has each slime has its own coordinates

Original thread: https://forums.rpgmakerweb.com/threads/jumping-slimes-and-collision.118341/