The only way to get the pila/javelin users to throw their javelins before attacking is to remove the "prec" ability from the export_descr_unit file. The side effect of this is that the units will now skirmish until they're out of missiles before they attack. However, sometimes they appear to attack even though they still have thrown ammo left.

So far I haven't been able to find a more suitable solution to this by modding.