Based on my own experience and programming skills, I would say that each monster probably has a
Pathing Algorithm that tells him how to move, where to move for, what to avoid and the maximum range from its
Home Zone it is allowed to move away, if it leaves its Home Zone, the mob will return to its zone and reset.
Also, what takes place here is time without receiving damage. If you run in front of a mob, it will follow you, but if it receives no damage in a matter of, i would say 8-9 seconds, it will stop chasing you.
There are two
Triggers for the mob to stop attacking you and run back to its original coordinates : Time without receiving damage and Maximum walk range reached.
Numbers still needs testing but the
Triggersare those, for sure, not taking in account the Underwater Environment which is sort of bugged causing monsters that are in battle with you face to face and in close range to sometimes, leave combat and regen full or half of its health for no good reason.