Y'shtola's second ability checks at the moment it would trigger to see if a player lost 4 or more life this turn. If none did, the ability won't trigger at all. Once an end step begins, it's too late to cause a player to lose life in order to cause this ability to trigger.

Artwork
Loading artwork…
Y'shtola, Night's Blessed
Final Fantasy Commander · #7 · EN
Nonfoil—Foil—
Card rules
Vigilance
At the beginning of each end step, if a player lost 4 or more life this turn, you draw a card.
Whenever you cast a noncreature spell with mana value 3 or greater, Y'shtola deals 2 damage to each opponent and you gain 2 life.
2/4
Mythic · Illustrated by Magali Villeneuve
Format legality
Brawl Legal
Commander Legal
Competitive Brawl Legal
Duel Legal
Gladiator Legal
Historic Legal
Legacy Legal
Oathbreaker Legal
Timeless Legal
Vintage Legal
Alchemy Not Legal
Future Not Legal
Modern Not Legal
Old School Not Legal
Pauper Not Legal
Pauper Commander Not Legal
Penny Not Legal
Pioneer Not Legal
PreDH Not Legal
Premodern Not Legal
Standard Not Legal
Standard Brawl Not Legal
Tlr Not Legal
Rulings
Published rulings from the downloaded Scryfall catalog. Source card record · Rules and interactions
Y'shtola's last ability resolves before the spell that caused it to trigger. It resolves even if that spell is countered or otherwise leaves the stack.
For spells on the stack with X in their mana costs, use the value chosen for X to determine the spell's mana value.