How to disable character running (Shift) for a while?

Hello, I would like to make a moment in my game where a character damages his leg and thus cannot run for some time. (But in the later part of the game, when she heals she will already be able to run).
How to make such a thing?
Sorry for my bad English.
Thank you in advance.
If it's on a specific map(s), you can check the Disable Dashing box in the map properties.

Otherwise, you can paste the below into a text editor, save as a *.js file, include as a plugin:

Code:
Game_Map.prototype.isDashDisabled = function() {
    return $dataMap.disableDashing || $gameSwitches.value(42);
};

That will disable dashing whenever game switch 42 is on (change the ID to whatever you like).
If it's on a specific map(s), you can check the Disable Dashing box in the map properties.

Otherwise, you can paste the below into a text editor, save as a *.js file, include as a plugin:

Code:
Game_Map.prototype.isDashDisabled = function() {
    return $dataMap.disableDashing || $gameSwitches.value(42);
};

That will disable dashing whenever game switch 42 is on (change the ID to whatever you like).
Thanks!

Original thread: https://forums.rpgmakerweb.com/threads/how-to-disable-character-running-shift-for-a-while.169650/