When is the game state checked for "Whenever you cast [...]" triggers?
A spell is cast and will trigger any 'on cast' triggers when all of the steps of casting the spell are complete and it is on the stack


  601.2h. Once the steps described in 601.2a-g are completed, the spell becomes cast. Any abilities that trigger when a spell is cast or put onto the stack trigger at this time.


At that point it only matter what the spell currently is. The game does not look back to the steps of playing the spell to see what it was at various points during the process.

Here are the steps required to cast a spell, detailed in 601. Casting Spells:


Announce (and place on stack) 
Choose (modes) 
Target  How (to divide) 
Total (costs)  
Mana (abilities, activate) 
Pay (costs)