The short answer is that to calculate your adjusted cost basis, you start with the original amount you paid for the property, add the cost of any capital improvements, and subtract your cumulative depreciation.
When it comes to mortgage debt, it gets a little tricky. For example, you use your initial purchase price as the starting point of your basis, regardless of whether you used a loan to finance the purchase of the property or not. On the other hand, if you assume the seller's existing mortgage debt upon the acquisition of a property, you would include it in your cost basis.
When it comes to refinancing a mortgage, the IRS doesn't say that any cash out is added to the cost basis. Aside from assuming an existing mortgage on the property, there's no mention in the IRS's cost-basis guidance of any amount of financing being factored into the cost basis. So, my opinion is that your $200,000 current mortgage would not be a part of the property's cost basis unless you used the cash you received to complete some sort of capital improvement to the property itself.
However, it's important to note that you can add the costs of obtaining the refinancing mortgage (points, origination fees, etc.) to your cost basis. In fact, "fees for refinancing a mortgage" is the only mention of refinancing in the current IRS guidance.
While this is certainly not the answer you wanted to hear, as it will increase the potential capital gains tax upon the sale of the property, there's a good reason for not being able to include it.
Think of it this way. When you took the $200,000 cash out of the property, you could have used it to acquire another property, and the money would then become the cost basis for that one. Or you could use the money to make capital improvements to the property you own, which would then be added to your cost basis. In other words, if you were able to include the $200,000 cash out in the cost basis, there would be opportunities to get a double tax benefit with the same money.
What's more, upon the sale of your property, the mortgage would likely be paid back from the proceeds.
With all of that in mind, if you decide to sell the property, I would strongly suggest consulting with an experienced real estate lawyer or a tax professional who often deals with rental properties, as they can offer personalized advice to your situation. The information here is a good starting point for me to give some tips and takeaways but is not enough to do a full evaluation of your cost basis in the investment property.