{
    onUpdate(pokemon) {
        if (pokemon.status === "psn" || pokemon.status === "tox") {
            this.add("-activate", pokemon, "ability: Immunity");
            pokemon.cureStatus();
        }
    },
    onSetStatus(status, target, source, effect) {
        if (status.id !== "psn" && status.id !== "tox")
            return;
        if (effect?.status) {
            this.add("-immune", target, "[from] ability: Immunity");
        }
        return false;
    },
    onSourceModifyAtkPriority: 5,
    onSourceModifyAtk(atk, attacker, defender, move) {
        if (move.type === "Poison") {
            return this.chainModify(0.5);
        }
    },
    onSourceModifySpAPriority: 5,
    onSourceModifySpA(atk, attacker, defender, move) {
        if (move.type === "Poison") {
            return this.chainModify(0.5);
        }
    },
    flags: { breakable: 1 },
    name: "Immunity",
    rating: 2,
    num: 17
}
