They did come out of the timeskip way more capable than what we were shown. Oda just kept having them hold back for the sake of Fishman Island, and Punk Hazard's fights not ending in a few panels.
Hordy stood no chance against Luffy, which is why Oda took the fight to underwater, and made a Devil Fruit user fight a Fishman underwater inside of a bubble, and even then Hordy only managed to land one attack throughout the entire fight, where he bit Luffy on the shoulder. The almost died aspect came from Luffy overexerting himself to destroy the Noah.
With Caesar he made Luffy's objective to only capture him, and not flat out defeat him. A little flimsy of a reason to not have Luffy destroy him immediately, but it served it's purpose to push the rest of the plot of Punk Hazard forward and established everything that was to come latter on in the series with Dressrosa and Wano.
With Doflamingo, who is a solidified YC level character, the fight was exactly opposite than that of Fishman Island and Punk Hazard, where Oda needed it to end sooner, rather than later. There was no 10+ hours to waste to have Doflamingo be defeated, which is what it would have boiled down to in a straight one on one fight.
With WCI, Oda put Luffy against the two characters of Big Mom's crew that were completely circumstantial. One who had an endless army at his disposal, and one who could see the future, and is closest to Top Tier than anyone Luffy had fought before. These two fights served as the catalyst to push Luffy closer to the top tier spectrum of the World, which was needed.
At the end of the day, had Luffy not come out of the Timeskip as strong as he was, then simply gaining AdCoO and AdCoA would not allow him to be where he stands right now.