As of yesterday, I have a mod that adds it. I gave ranged units an ammo counter, initialized in their template, and made it so if they run out of ammo but have a melee weapon defined (or if their target gets within their minimum range) they will switch to melee and charge. The ammo count gets reset if they spend enough time out of combat, allowing you to retreat and rearm.
I'm still debugging some things and the animations transitions are a little wonky sometimes, but it should be ready to share in not too long (few more weekends maybe). Honestly, I'm surprised no one else has ever tried this before. Other than accounting for interrupted attacks it was not hard to code. Took me like two days, and I barely know any Java. This community has weird development priorities IMO.
The first time watching my maniples of Hastati throw their 2 pila and charge with gladius in hand was way more gratifying than adding another civ to the pile...