Welcome to Smogon! Take a moment to read the Introduction to Smogon for a run-down on everything Smogon, and make sure you take some time to read the global rules.
If a pokemon uses a stat boosting ability such as "Calm Mind", and doesn't baton pass it but instead switches out.
When it switches back in would it retain the stat boost?