questions about zelda-like combat without abs plugins

hi all, as part of a small project i've chosen to try to make a small game with combat that plays like an old zelda game (like the zelda 1, or links awakening, etc)
being pretty early on in the process i haven't gotten much done, but i've begun working on the sword mechanics. getting the sword to swing when i press Z is easy enough, its just some other details i need some assistance with.

firstly, (and the smaller of the two asks) is how to get the player to stop moving for a few frames once Z is pressed. below is a screenshot of the parallell event that allows the player to swing a sword:
View attachment 291793

it plays a sound effect, changes the player image to one of them swinging the sword, and after 5 frames of that, it changes them back to normal.
my question is: is there a way to force the player to stop moving for something like 5 frames? because as it is, the player just keeps moving as the sword is out and i want them to stand still


next, (and likely the more complex of my two questions) is how to get an enemy to take damage if hit with the sword. right now, my idea would be that while the sword is out, a switch would be turned on, and if there's an 'enemy event' directly in front of the direction the player is facing, they'll take a hit and possibly get sent backward a tile.

i guess i want to know if any of this is possible without a plugin? is it worth my time to just get one? im mainly going without right now since a lot of ABS plugins have a lot of other features that i'd just have to axe because i only really want like, a sword and bombs i guess. thanks to any and all who see this!
There are minimalist ABS plugins that just provide dungeon tool functions without going full ChronoEngine. CT_Bolt had one and there's some Japanese one I'd have to dig up.

This script will stop the player from being able to move
Code:
if($gamePlayer.moveByInputCached === undefined)
//This checks if the value is undefined

$gamePlayer.moveByInputCached = $gamePlayer.moveByInput;
//If it is undefined, it sets to the current value of $gamePlayer.moveByInput which is 'true'

$gamePlayer.moveByInput = function(){
return false;
}
To enable movement again
Code:
$gamePlayer.moveByInput = $gamePlayer.moveByInputCached;
//This resets the value of moveByInput to the cached value
thanks so much, the scripts worked perfectly!! did you happen to know what CT_Bolts plugin was called? i looked over their itch page but couldnt seem to find it (but maybe i just didn't look hard enough)
If your enemies are events, you can assign them an HP value when the map loads.
this value can be stored in a property of the event object for example, which is just 1 simple script call, but the downside of that is the value will reset when you switch maps.
Another method is to use "self variables" (Yanfly has a plugin for that), which don't require a script and their values are retained across maps.
When you strike an enemy, you use a script call to lower its HP value based on how you defined it.
ah perfect!! i had no idea there was a plugin like that, thanks so much
i actually don't mind the enemies being reset after each map change since that's what happens in most top-down zelda games 😛
Then all you need are these script calls:

initialize HP value (replace 100 with any amount you want):
this.character(0)._hp = 100

lower HP value (replace 10 with any amount you want):
if (this.character(0)._hp) this.character(0)._hp -= 10

check if enemy is dead (script inside a conditional branch command):
this.character(0)._hp <= 0

if you're using an outside event to control the battle flow, replace this.character(0) with $gameMap.event(eventId)
thanks so much, the scripts worked perfectly!! did you happen to know what CT_Bolts plugin was called? i looked over their itch page but couldnt seem to find it (but maybe i just didn't look hard enough)
It wasn't a plugin, it was eventing.

Original thread: https://forums.rpgmakerweb.com/threads/questions-about-zelda-like-combat-without-abs-plugins.164788/