Hi! I'm new to RenPy in general, but so far it's been fairly intuitive for the most part. This is how I'd do it:
- First you'll need to decompile script.crpy and the corresponding enemyname.crpy files of the enemies you want to mod into *.rpy files (found in "game" and "game/Enemies" respectively).
View attachment 5389743
I use 
un.rpyc to do this. Just place it in the "
game" folder and 
run the game to automatically decompile all .crpy files.
- Then you'll need to write code for the enemies. Open the enemyname.rpy file of the enemy you want to mod in a text editor and try to understand how the fight works. Decide where the draining should happen, or come up with new code to give the enemy a new attack or pattern. Whenever you want them to lower the player's stats you'll need to call lostatt(), which looks like this:
- lostatt(stat=None, amount=1)
- The stat should be "STR","AGI","VIT","INT" or "CON". If you type "None" or don't provide a name, the stat decreased will be random.
- The amount represents how many points of that stat will be lost, it's 1 by default but you can make it higher.
 
- This means that you'll have to write something like this to use that function (the $ sign at the beginning is important):
- $ lostatt("VIT") - Lose 1 point of VIT
- $ lostatt("INT", 2) - Lose 2 points of INT
- $ lostatt() - Lose 1 point of a random stat
- $ lostatt("None", 5) - Lose 5 points of a random stat
 
- Now, if you want the enemies to remember how much of each stat they have drained, there's 2 ways I can think of
- In script.rpy add a variable to keep track of this. Around line 181 of the script, there are a bunch of variables dedicated to enemies, so if you wanted Laura to drain INT, for example, you could add something like:
- default laura_drained_int = 0
 
- Now you can use this variable in the enemy code, for example:
- $ lostatt("INT", 2)
- $  laura_drained_int += 2
 
- This way you can keep track of that variable during the entire run, and use it to alter the enemy's behaviour
 
- Way number 2
- In the enemy file itself you can do the same, add a variable at the top of the code just like we did in script.rpy, but I'm unsure if this variable gets saved during the entire run or if it gets reset every fight.
 
I hope this helps you design an interesting battle!