You have to judge their movements. If they are charging at you with high speed and don't flinch at all, ready your melee weapon instead of throwing. If they stop, strafe around, or start feinting from 10 feet or so then throw. Remember, changing the weapon mode from throwing to melee is faster than actually switching weapons! Give you a little more room for error.