China prefers peaceful reunification. They don't want to fight a war if they don't have to. At the same time, peaceful reunification is a core interest of China. Which means that they will go to war, but only if they believe peaceful reunification is no longer possible.
So yes they do watch the US to make calculations. But even if the US is weak, they still don't want a war as long as they believe peaceful reunification is possible.
Furthermore, Taiwanese reunification is not only a core interest, it's also possibly the most emotional one for the Chinese. Large portions of the population support reunification, and they will overthrow whichever leader lets Taiwan go.
This is why "raising the stakes" by announcing military support for Taiwan does not deter China. Quite the opposite: they encourage China to go to war, costs be damned, because such foreign support signal that peaceful reunification will become impossible.
As for Hong Kong, see my comment here https://news.ycombinator.com/item?id=31705632