The use of nuclear weapons is a special category (weapons of mass destruction) even within the relatively unconstrained use of force envisioned in high intensity conflict. Generally speaking, in the Post-Cold War era, their use is reserved to those cases where continued existance of the state is threatened. During the Cold War, Soviet and NATO doctrine had these weapons being released to strategic and operational commanders. Though both sides trained for this employment, it, mercifully, never occurred.
Since the existance of the PRC, US, or Japan (as a non-nuclear US ally) is not endangered in this scenario, there has to be another escalating factor that triggers their use. Combat losses, even though severe, are not a justification; their acceptance is part and parcel of the decision to engage in military operations.
The Chinese know this and so does the United States. (Ditto for India and Pakistan in the example you cite.)
Of course, there is always the possibility of a miscalculation, especially when fickle and excitable politicians are involved.
Good answer but you are assuming that the Chinese are as rational as you are. I hope you are right.