Dragon Quest Boomerang Formula Help

I am attempting to make a damage formula that hits all enemies and does less the more enemies are alive. The problem has to lie with my formula as it does 0 damage no matter how low the enemies defense is.

The formula I am using is as follows:
((a.agi * 4 - b.def * 2) / 3)) - ((((a.agi * 4 - b.def * 2) / 3))) * ($gameTroop.aliveMembers().length - 1)) * 0.1)

The boomerang is one of the 7 main weapons in the game, and so I thank anyone who takes the time to look at this.
Have a nice day.
Brackets!

Code:
((a.agi * 4 - b.def * 2) / 3) - (((a.agi * 4 - b.def * 2) / 3) * (($gameTroop.aliveMembers().length - 1) * 0.1))
I'll second what @Soulrender has said, it's very difficult to see what you're actually trying to do because adding or removing brackets could change your result in a way you haven't intended.

Code:
(a.agi * 4 - b.def * 2)/3 - (a.agi * 4-b.def * 2)/3 * ($gameTroop.aliveMembers().length-1) * 0.1

This achieves what you've described and doesn't require any double/triple/quadruple nest brackets - keep it simple. 🙂

As a side note, the below also does the same:

Code:
(a.agi * 4 - b.def * 2)/3 - (a.agi * 4-b.def * 2)/30 * ($gameTroop.aliveMembers().length-1)
Thanks guys! I guess I got too into my head and couldn't see the simple solution. These work great.

Original thread: https://forums.rpgmakerweb.com/threads/dragon-quest-boomerang-formula-help.116345/