How to pause everything on the map

Hi,

 I want to be able to pause/start everything on the map  (like when u open the menu by pressing 'esc'), does anyone know how to do it?

Thanks
http://yanfly.moe/2015/12/01/yep-35-stop-map-movement/
thank you i tried but is not what i was looking for, it does stop the eveents but it let them finish the curren movement first.

What i'm looking for is the same effect as when you open the menu, everyhing stops right away and events freeze in-between tiles

Original thread: https://forums.rpgmakerweb.com/threads/how-to-pause-everything-on-the-map.54274/