Pokémon Gold Version, Silver Version, and Crystal Version - Fainting and Switching Out
If a Pokémon faints at any time during its attack segment, including the end of its attack segment, no end-of-attack effects are applied to either that Pokémon or the new Pokémon, and if the Pokémon struck first, the opposing Pokémon’s attack segment is skipped. (If the opposing Pokémon used Hyper Beam on the previous turn, it "must recharge" on the next possible attack segment.)
If a Pokémon faints before the end of an opposing Pokémon’s attack segment, usually as the result of an attack, no end-of-attack effects are applied to the opposing Pokémon.
When a Pokémon switches out or uses Baton Pass, the Pokémon that replaces it does nothing during its attack segment but any end-of-attack effects are still applied to that Pokémon.