Need help with my custom battlesystem

I am working on a very basic battle system, enemies in form of events are on the screen, and when you or them walk into each other, a common event is called where it displays attack animations for the enemy and the player, now my question is: How do I call the player and monster stats into the action so they can damage each other?

This is what my combat common event looks like:
test-01.png
I'm slowly figuring things out, I learned that this gets the enemy stats using script:
$dataEnemies[1].params[0]

$dataEnemies[1].params[1]

$dataEnemies[1].params[2]

$dataEnemies[1].params[3]

$dataEnemies[1].params[4]

$dataEnemies[1].params[5]

I think this is correct?
stats.png


My new question would be, how do I get the player stats?
by using control variable command (game data section)
Thank you very much! Now I can put the player stats into variables!
Slowly but surely things are fitting into place.

I can now make the enemy hit the player, making the player lose HP based on the monster strength.
battleengine.png


My new question is: How do I throw in player DEF in the calculation?
You'd be best creating another variable to hold the "damage" value. Set the variable to 0 at the start of the event, then add the enemies attack, then you can subtract your actors defence. From there change your actors hp to be minus the damage value.

Spoiler
upload_2019-2-21_18-23-17.png
Ahh, simple enough. I got it working perfectly. Thank you.
Alright, I got it working well, enemy events can even be killed. I did a slight modification to the code but it works great. I do however have another question : How do I load in the enemy HP so it's not no longer killable in 1 hit?

70194.png
You'll have to be more specific. I don't know what you mean by "load in the enemy HP".
Alright. As it is now it has a check for the "control variables : #0009 Rat HP - = PLAYER ATK

I have a separate common event holding the rats HP: Control variables : #0009 Rat HP = $dataEnemies[1].params.[0]
PLAYER ATK also has a separate common event : Control Variables : #0006 Player ATK = Attack of Noob

My question would be, how I got that into the combat common event when it's the players turn to deal the damage, so the enemy rat can take damage, like the player does

As it is currently, only the player can get damaged
Heh, I figured it out, I placed the battle system in a loop underneath a control variable for the health, now it works, the rat has HP! Thank you ever so much for all the help!

Original thread: https://forums.rpgmakerweb.com/threads/need-help-with-my-custom-battlesystem.105893/