I am trying to make a state that makes it give the actor a perk.
The effect I would like it to have is this:
Take the DEF stat. Divide it by 5 (20%). Then, apply that number as a bonus to both the STR and SP. ATK statistic. Refresh each turn, so that bonuses can be applied.
For some reason, this doesn't appear to calculate correctly and my numbers have been unchanging on my end. I have spent so much time on this to no avail. I would appreciate any help, especially because I am someone who knows nothing about JS.
NOTE: I have made edits to remove the AI code that I had used to try to solve my problem, at the request of one of the comments.
The effect I would like it to have is this:
Take the DEF stat. Divide it by 5 (20%). Then, apply that number as a bonus to both the STR and SP. ATK statistic. Refresh each turn, so that bonuses can be applied.
For some reason, this doesn't appear to calculate correctly and my numbers have been unchanging on my end. I have spent so much time on this to no avail. I would appreciate any help, especially because I am someone who knows nothing about JS.
NOTE: I have made edits to remove the AI code that I had used to try to solve my problem, at the request of one of the comments.