Do I think Ukraine would like to hold a press conference at which they show the media a set of nuclear weapons that they will use against Moscow should there be anymore attacks on Ukrainian cities? Yes, they would like that. I don't think that the West will willingly allow that.
Does Iran want to acquire nuclear weapons (if they haven't already)? Absolutely. Would Taiwan want to acquire nuclear weapons? Probably.
Why do Pakistan and India both have nuclear weapons? Because they both believe that MAD will prevent the use or large scale invasion of their country.
Just do it. The West will condemn Ukraine. And then move on. Russia will never dare to invade Ukraine again. But first Ukraine will have to win this war. Then they can build nuclear weapons in secret.
“I am sure that Ukrainian military and political leaders feel that had they not given up their nuclear weapons, Russia would never have attacked.”
Well, they had the weapons, but Russia still had operational control (launch codes, etc) of the weapons. So they were essentially useless to Ukraine for any defensive purpose. Thus Ukraine thought they were trading something useless for something useful (security guarantees from both Russia and the West). Unfortunately for them security guarantees are only as reliable a deterrent as the resolve of the parties making the guarantees are reliable.
Ukraine never had nuclear weapons. The internationally recognized successor state to the Soviet Union is Russia, any Soviet weapons in Ukraine belonged to Russia.