When you take the Attack action on your turn and attack with [this weapon], you can choose to forgo all but one of the attacks made as part of the action. You must choose to do so before the attack roll of the first attack made as part of this action. If you do so and then hit with that attack, roll all of the attack's weapon damage dice an additional number of times equal to the number of forgone attacks and add them together. Then add any relevant modifiers this additional number of times as well.
My reasoning for the phrasing is as follows:
The beginning is taken from a combination of two-weapon fighting:
When you take the Attack action and attack with a light melee weapon that you're holding in one hand, you can[...]
...and the Battlemaster fighter's Commander's Strike maneuver:
When you take the Attack action on your turn, you can forgo one of your attacks[...]
The "You must choose to do so before the attack roll" bit ensures that this choice is made before the attack roll is/any extra attacks are, and comes roughly from the wizard's Portent feature:
You must choose to do so before the roll[...]
The phrasing of how to roll additional dice and add it/modifiers to the result is based on the critical strike rules, modifying it for rolling and adding more than just 'twice':
Roll all of the attack's damage dice twice and add them together. Then add any relevant modifiers as normal.
The phrasing for "an additional number of times equal to the number of forgone attacks" doesn't really have a base I could find (and, honestly, feels slightly off-spec to me), but ensures there's no trickery such as benefiting from heavy blow on a haste'd Attack action.
Note that compared to the critical strike rules, I added very specifically weapon damage dice (à la the XGtE Orcish Fury feat) to avoid things like freely doubling Divine Smite damage... or at least I'm pretty sure that tweak blocks that, since Divine Smite damage is considered "in addition to the weapon’s damage" rather than 'additional weapon damage'.
As @Ryan Thompson notes, this allows any features that apply an extra one-time flat modifier to be multiplied, such as the goblin's Fury of the Small. If that is a concern, you could modify the last sentence to be along the lines of:
Then add any relevant modifiers this additional number of times as well, unless the modifier is limited in how often it can be applied.
That's getting into the territory of being out of 5e's style, and may require more frequent individual rulings.