Why was Yugoslavia created after WWI, instead of a more or less Greater Serbia?
-First and foremost, cultural and political Yugoslavism from before the war.
-Croatian and Slovenian fear of Italian territorial claims.
-The fear of Croatian political elites of the Green Cadres: a sizeable countryside rebellion, which they inherited from Austria-Hungary and which they were not able to squash on their own.
Yugoslavism was an old, old process and tendency, and by this point you probably couldn't stop it any more than you could stop an avalanche rolling down the mountain. You could avoid or change certain important milestones; like the birth of a Croat-Serb coalition in 1905. But that's not easy either, and it would derail other things.
To avoid the Green Cadres, you'd need to have the war end in 1917, before these rebels start popping up like mushrooms across Croatia and other Habsburg crownlands.
The fear of Italy could be dealt with in a few ways. Maybe Italy experiences some kind of unlikely severe screw-up, is temporarily knocked out of the war, and loses much of its clout. Zagreb decides it has nothing to fear from that corner and is less likely to accept Yugoslavia, although the question of the Green Cadres remains open.
Or maybe Italy fights superbly and delivers severe blows to Austria; then it's able to back up all its territorial claims in the Adriatic with boots on the ground and diplomatic prestige. This is also one way the war might be ended before the Green Cadres enter the scene. In this scenario, the rest of Croatia and Slovenia is possibly puppetized by Italy; in any case, Serbia has no choice but to accept Italy's ideas and dial down its programme into a Greater Serbia.