Looking to code a basic plugin for states to be able to call states, specific to my game.

Could anyone point me to the proper syntax for doing something like the following?(Note, this is pseudo code written akin to C++ because that is my most comfortable language):
void damageOverTime

void damageOverTime()
{
bool resist;
if target.AcidResistI==true //unsure how to specify a standard target so that this can be called for both actors and enemies
{
resist=true;
float InsertDamageOverTimeHere;
float newDamage=InsertDamageOverTimeHere*0.6;
}
//else-if
// else-if
// else
return newDamage;
}
I don't remember how exactly I would then call this specific function, however this is a rough draft for questions anyways.

tl;dr: looking for MZ plugin related syntax for checking if a character has a damage resistance trait for acid/poison to then adjust the tick damage accordingly from the 'slip' effect.

If this is able to be handled in engine however as well that would be awesome to find out, though I have been reading that parallel states do not work all too well with combat cycles, so a passive state of having an always active acid resistance probably wouldn't turn out very well in the default engine. I felt as if a plugin would better suit the handling of damage resistance to specifically damage over time spells or skills at first, seeing as local variables cannot be pulled past notetags in the skills from what I understand without use of a plugin.

Original thread: https://forums.rpgmakerweb.com/threads/looking-to-code-a-basic-plugin-for-states-to-be-able-to-call-states-specific-to-my-game.144447/