Yes, closing costs paid on your own behalf or for the buyer are costs of the sale.
However, these costs will increase your cost basis. Increasing your cost basis reduces the amount you pay taxes on.
But I'm still not clear on where you actually roll the Seller credit into the equation as it's not included in the J. Total Closing Costs of the closing disclosure. Just add it to the allowable closing costs as a sales expense?
(Working from a Substitute From 1099 Seller)
Credit given to the buyer at closing should have been included in the HUD-1 , closing statement -- not on the 1099-S. If however, this adjustment was kept out of the settlement statement ( HUD-1) , for whatever reason, then you enter this as cost of sales -- like commissions, transfer taxes,.... misc. expenses. As mentioned by @KittyM , this would reduce your sales proceeds ( NOT your COST Basis ) and thus reduce your gain ( capital or ordinary ). Does this help ?