King Władysław IV lives longer. He doesn't die in 1648. Since he is alive, when Khmelnitsky's Uprising starts he manages to negiotiate a deal with Cossacks (he was actually quite popular among them). The register of Cossacks is augmented, some of the Cossack leaders are nobilitated, king promises to protect Cossacks rights and privileges. Polish-Lithuanian-Ruthenian magnates are unhappy with that, and one of the, Jeremi Wisniowiecki, makes a terrible mistake and starts an open rebelion. Since the Sejm hasn't yet debated about treaty with Cossacks, most of the noblemen consider Wisniowiecki's action illegal and unnecessary - if he was against the deal, he would have an opportunity to talk about it in the Sejm. Charismatic Wiśniowiecki gathers around him thousands of most unruly noblemen and marches onto Warsaw. King Władysław calls Cossacks for help.
In the battle of Lvov, Wiśniowiecki defeats first royal army, commanded by the grand hetman of the Crown, Mikołaj Potocki. Unfortunately, some noblemen from WIsniowiecki's army start a destructive raid to west and, mostly by accident and lack of discipline, destroy a few villages belonging to powerful Zamoyski family, killing one of of their less importatn cousins. Important or not, Zamoyskis' honor demands blood and powerful magnates give the king their full support. Some of other powerful families do the same, not because of their love for the king, but because they worry about Wisniowiecki's ambition. Other magnates remain neutral, but their partisants do not interfere in Sejm with king's actions. Wisniowiecki is forced to besive heavily fortified Zamośc and Lvov, since he can not leave two powerful and hostile fortresses behind his back.
Władysław IV is ill, but still has some energy left. In early 1649 he personally leads a second army against Wiśniowiecki. In the battle of Zamośc rebel army is destroyed, Wiśniowiecki himself is killed, and his enormous fortune confiscated. Victory was possible by a timely arrival of Cossack army led by Khmelnitsky.
Victorious king Władysław retuns to Warsaw with an army. His position is now much stronger, but he knows he can not count on gaining an absolute power. Nevertheless, he manages to make the Sejm accept the deal with the Cossacks. Grand hetman Potocki resings his position and in turn is nominated as a special commissioner to protect Cossack rights.
A year later Tatar army invades Ukraine. Now Cossack ask their king for help and they are not disappointed. Royal army arrives in time and together with Cossacks defeats the invaders. But this is too much for the ill king. Cossacks are devastated when two days later their "father the king dies.
During the election freshly nobilitated Cossacks give all their support to Hohn Casimir, Władysław's brother. Meanwhile, Muscovian army invades Lithuania. Lithuanian army led by Janusz Radziwiłł (Radivla) and magnates' private forces fight desperately but they are outnumbered and forced to retreat. Polish and Cossack armies join forces and with quick march surprise the Russians. The war ends with full victory for the Commonwealth.
When Swedis King Charles X Gustav looks for some loot for his army, strong and united Commonwealth, with relatively big and experienced army does not seem like a good candidate. Prussia, OTOH....
Totally improvised TL, feel free to tear it apart.