MZ How to change this code so it'll make HP tick down instead of up?

So using the Toxic code from Trihan's How to implement every possible Yanfly Tips & Tricks effect in MZ I want it to start from the percentage and tick down every turn instead of ticking up. Here's the code from the thread:

<JS On Add State>
this._toxicCounter = 1;
</JS On Add State>

<JS Pre-Regenerate>
const n = this._toxicCounter / 16;
const value = Math.floor(n * target.mhp);
this._toxicCounter++;
target.gainHp(-value);
</JS Pre-Regenerate>
Where it says gainHp, make the value not be negative.

I think I misread the question.

What does "start from the percentage" mean?

Do you want it to start by doing a lot of damage and do less every turn? Just change the toxicCounter = 1 that it starts with to be some higher number, then change toxicCounter++ which is adding with a plus to toxicCounter-- which is subtracting with a minus.

But you'll need to add a check after it so that it doesn't go into negatives once it hits 0. Do you want it to be a minimum of 1? Do you want the state to go away at that point? Please explain.
Where it says gainHp, make the value not be negative.

I think I misread the question.

What does "start from the percentage" mean?

Do you want it to start by doing a lot of damage and do less every turn? Just change the toxicCounter = 1 that it starts with to be some higher number, then change toxicCounter++ which is adding with a plus to toxicCounter-- which is subtracting with a minus.

But you'll need to add a check after it so that it doesn't go into negatives once it hits 0. Do you want it to be a minimum of 1? Do you want the state to go away at that point? Please explain.

Sorry i was in a rush so I worded it poorly. But you're solution was what I needed so thank you! I'm not gonna worry if it hits the negatives, the state only several turns.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-change-this-code-so-itll-make-hp-tick-down-instead-of-up.164627/