Sledgehammer vs. Leather Armor

Sledgehammer vs. Metal Armor

Spear vs. Combat Armor

Each item on the list will have text like that so that the players can easily differentiate between them, but they will have reasonably complex calculation beneath them. I will need to write this calculation by hand. An example would be

*/r (1d8+4)*(0.75)-2*, and each item on the list would have a different calculation beneath it.

The twist is, beneath this list, but on the same popup window, there will need to be a field in which I can input a number, say +7, +11, or whatever, and somehow the macro will need to be able to calculate out how to input that number into the calculation. For instance, using the above formula I just posted, if a player were to enter in +11, then the formula would need to be revised on the fly to:

*/r (1d8+4+*

**11**)*(0.75)-2Is what I'm looking to do even remotely possible? And can it be done in a way that a coding idiot like me might be able to work with it?