One way which might work is to make unit's hammer cost very high (say, 100k), but change the hurry cost modifier. I did it to make units un-purchaseable, but it should work the other way around.
<Cost>100000</Cost>
<HurryCostModifier>1</HurryCostModifier>
so, gold cost for this unit should be like a cost for 100000 * 1% = 1000 hammers unit. I haven't tried it exactly this way though.