the value is replaced with available gas right?
As a bit of a simplification, yes.
IIRC, I believe the amount of gas forwarded to the callee is actually 63/64ths of the remaining gas in the transaction.
No there is no way to know it reliably. Even sending the same transaction multiple times may result in different gas amounts. (See for example here Why gas-used are different for same transfer() tx? ). Also other factors make it difficult/impossible to estimate it correctly, such as loops (can we know in advance how many times we will loop?).
The amount can ...