{
    onStart(pokemon) {
        for (const ally of pokemon.alliesAndSelf()) {
            if (["psn", "tox"].includes(ally.status)) {
                this.add("-activate", pokemon, "ability: Pastel Veil");
                ally.cureStatus();
            }
        }
    },
    onUpdate(pokemon) {
        if (["psn", "tox"].includes(pokemon.status)) {
            this.add("-activate", pokemon, "ability: Pastel Veil");
            pokemon.cureStatus();
        }
    },
    onAllySwitchIn(pokemon) {
        if (["psn", "tox"].includes(pokemon.status)) {
            this.add("-activate", this.effectState.target, "ability: Pastel Veil");
            pokemon.cureStatus();
        }
    },
    onSetStatus(status, target, source, effect) {
        if (!["psn", "tox"].includes(status.id))
            return;
        if (effect?.status) {
            this.add("-immune", target, "[from] ability: Pastel Veil");
        }
        return false;
    },
    onAllySetStatus(status, target, source, effect) {
        if (!["psn", "tox"].includes(status.id))
            return;
        if (effect?.status) {
            const effectHolder = this.effectState.target;
            this.add("-block", target, "ability: Pastel Veil", "[of] " + effectHolder);
        }
        return false;
    },
    onSourceModifyDamage(damage, source, target, move) {
        if (move.type === 'Poison' && (target === this.effectState.target || target.side === this.effectState.target.side)) {
            this.debug('Pastel Veil - reducing damage');
            return this.chainModify(0.8);
        }
    },
    flags: { breakable: 1 },
    name: "Pastel Veil",
    rating: 2,
    num: 257
}
