const effect = args[0];
const targetIds = args[1];
const extra = args[2];

async function main() {
    for (const tokenId of targetIds) {
        let token = game.canvas.tokens.get(tokenId);
        let actor = token?.actor;
        if (!actor) continue;
        const active = actor.effects.find(e => e.data.label === effect.label);
        if (active) {
            await token.toggleEffect(effect, { active: false });
            console.log("Removed active effect", effect.label, token.name, token);
        }
    }
}
main();