Need some help with making a buff / debuff removal skill

I'm currently trying to make a skill that damages the enemy and removes debuffs from the party. I used the damage formula to deal the damage and I used a common event to apply the debuff removal effects to the party.

I found a way to do it using removeBuff method, but it removes both debuffs and buffs from a battler, as opposed to just removing buffs or debuffs only. Here's my code:

JavaScript:
    for(let i=1;i<=4; i++) {
        var actor = $gameActors.actor(i);
        for (let j=0;j<8; j++){
            actor.removeBuff(j)
        }
    }

Is there a method that can just remove buffs or just debuffs? Or any other suggestions on how I can do this? Thank you for your response! (Oh and for some reason the "removeAllBuffs" method didn't work for me so I used loops instead.)

Original thread: https://forums.rpgmakerweb.com/threads/need-some-help-with-making-a-buff-debuff-removal-skill.147129/