According to this breakdown, modifiers (attack, speed, whatever) happen in an order based on what is causing the modifier, bei it an attack, ability or whatever: https://www.smogon.com/forums/threads/sword-shield-battle-mechanics-research.3655528/page-59#post-8685465
I'm wondering specifically...