Way to calculate how much gas was used in trx is to destruct the transaction object as below and multiply gas used with gas price.
const transactionResponse = await fundMe.withdraw();
const transactionReceipt = await transactionResponse.wait(1);
const { gasUsed, effectiveGasPrice } = transactionReceipt;
const gasCost = gasUsed.mul(effectiveGasPrice);