MZ Return X and Y of Tiles Between Two Positions

Sorry if I have so many questions, but how do I return all the passable tiles(x, y) from point A to point B with the shortest route? I already done this by letting an event walk using RPG Maker's default pathfinder. But in every map load, I need to do this like 50 times. I think it's causing some lag.

How to do this without a walking event?

Update: Already solved my problem by modifying the findDirectionTo() function inside mmz_objects.js (although I copied the entire inside another function).
That is basically what pathfinding does - you just want the primary result instead of giving that as commands to an event.
And pathfinding is mathematics - nothing more and nothing less.

Most of the pathfinding scripts and plugins use the A* algorithm.

I suggest you search the internet for those terms and read up a bit on this, because you'll need those mathematics to understand the return data from whatever pathfinding script or plugin you are using, and then access that.
That is basically what pathfinding does - you just want the primary result instead of giving that as commands to an event.
And pathfinding is mathematics - nothing more and nothing less.

Most of the pathfinding scripts and plugins use the A* algorithm.

I suggest you search the internet for those terms and read up a bit on this, because you'll need those mathematics to understand the return data from whatever pathfinding script or plugin you are using, and then access that.
Thanks for the suggestion.

Original thread: https://forums.rpgmakerweb.com/threads/return-x-and-y-of-tiles-between-two-positions.147123/