You have to recapture depreciation regardless of gain or loss on the property. The reason is that you were able to either deduct the depreciation against income (either in each you you applied it or any remaining carryover loss when you sell).
Federal tax on recapture is 25%. State is whatever your tax rate happens to be (likely near the max of 9.3%). Hopefully your federal tax break you received previously due to depreciation was at least 25%.
Yes, you do reduce the cost basis by the amount depreciated as SD R wrote above.
So, to expand on the example, you’d have to pay the FED’s 0.25*15000 = 3750 in depreciation recapture tax. You’d have to pay CA up to 0.093*15000 = 1395.