1) You said healthy or not law will lose when we know for a fact Luffy would have won while being weakened
2) Yes he would have won. Doflamingo was second away to be finished after Leo bazooka but instead of giving the finishing blow right before the time limit of g4 came to an end, he wasted time discussing with citizens because he thought it was already over before looking at the sky and still came close to land that punch but plot saved Doflamingo there because Oda wanted a second round to show Luffy king Kong gun
3) Law is nowhere near coming close to make post gamma knife Doflamingo barely able to walk or wobbling after Leo bazooka like g4 did.Doflamingo defeated him while multi tasking with Luffy, with no parasite, rarely using haki, no clone, no awakening all that with no killing intent(since he wanted to leave him alive for the immortal ability of his fruit) with none of his s attacks bar gamma knife being strong enough to even affect him much(Doflamingo took his injection shot far better than red hawk which is weaker than Luffy g3 techniques let alone his g4 techniques not even counting king Kong gun)assuming he evenmanages to land hits(Doflamimgo not only is faster, but has better combat support with his clones,hax with parasite Law can't handle let alonei awakening he has no counters of). It will be a slaughter
1. Which is why dozens of people needed to help Luffy win.
2. Because those two seconds would have made a difference? Luffy blew out of G4 before he got close to Doflamingo. At best, with those extra two seconds, G4 would have ended right in front of Doflamingo/plateau. Besides, by this logic, I can say Law could have beaten Doflamingo by swapping him with some of the sea inside the room he made rather than swapping himself with Doflamingo when Doflamingo was about to kill Sanji. Or swap Trebol and Doflamingo's personalities. "Plot" is a lame-ass argument in this fight since pretty much all of it was plot.
3. And Law didn't use techniques like the Personality Transplant or cuts with the range of the ones he used against Vergo. Law was obviously stalling Doflamingo due to needing to build up the energy he'd need for the massive Room and the Gamma Knife. Not using Awakening, Haki, clones, etc. got Doflamingo laying on the ground and his organs torn apart. It's not that Doflamingo could afford to not use those techniques, it's that Doflamingo got cocky and suffered the consequences of it.
Even while fighting Doflamingo on the bridge and on Green Bit, Law didn't do any cuts like the one he did on Punk Hazard because he was intentionally trying to avoid killing Doflamingo to avoid facing Kaido's wrath. Not to say that Law could have done so had he wanted, but Law was purposefully holding himself back. Once he resolved to kill Doflamingo himself, he took advantage of Doflamingo's cockiness and managed to inflict Gamma Knife.
I say Law would present the same difficulty as Luffy would because, should Law be at near max health like Luffy was by the time he resolved to kill Doffy himself, his hax can provide many of the same capabilities that Luffy achieves with brute strength and raw power.