How do we define losing Taiwan?
(1) Taiwan joining United Nations: this is impossible as long as China does not attack Taiwan. If Chinese does attack, then there is a (small?) chance as China could be defeated (anything could happen in this world, e.g., a large scale war occurs between US and China and China could be defeated)
(2) Taiwan changes its name to Republic of Taiwan from Republic of China: how many people in this world cares that name change except for some hardcore Chinese? At least I know 99.999% Americans cannot distinguish Republic of China from Republic of Taiwan. Is $10000 billon war worth this stupid name change? Should I kill you if you change your name from Da Hua Wang to William Wong? Of course not!
(3) Taiwan has an independent government: it has it already.
(4) Taiwan has its military: it has it already.
(5) Taiwan gets more diplomatic recognition: again this is impossible if China does not attack Taiwan. If China does attack Taiwan, then there is a chance for that to happen.
(6) Taiwan gets nuclear weapons: this is in fact a good excuse for attack, just like Jewish people cannot tolerate Arabians to have nuclear weapons.
Above all, the loss of an attack is far greater than the gain. If China does want to attack, China has to be as strong (relatively) as Germany before WWII, and needs to be far stronger than Japan (relatively) before WWII. Read history books: Japan was easily defeated by US and Soviet Union in WWII.