Gold value based on party level

I want:
After battle, some enemies drop/left a chest, so the player can open, discard — or if any party member have a Disarm skill — find and disarm traps. It's like the first Phantasy Star (Sega Master System).

I did everything and it's working, but now, the...

Problem
I want to give gold based in party and enemies levels. This one looks like a good start, but I don't know how to get some values. How to get all party (or single actor) attack, defense, etc, to make a calculation? Or only an average of party level?

EDIT: I did almost all I needed. Just needing some help with Troop values. $gameTroop.members()[0].hp is ok, but how to get luck, agility and other values?
Open the developer console (f8) in battle and type in $gameTroop.members()[0]
You'll immediately see everything.
Good, thank you. I'll explore it.
Even on console I couldn't find such values. It gives only hp, tp, mp, and an array of "paramPlus" all zeroed.

6DfvG3E.jpg
And what is this? Btw. These things contain dots, but these dots are clickable. That's because they represent getter functions or something like that.
Screenshot_465.png
If obj is a game actor or game enemy, it's just obj.luk, obj.agi, etc.
Poryg is right, I was trying to call like $gameTroop.members()[0].states or _states...
Correct is $gameTroop.members()[0].agi, etc. Thank you.
Just remember to run that IN the battle, and not on the map. $gameTroop is only relevant during a battle.
Sure. I'm using it at battle start to get troop's average luck and gold (still testing some formulas). Thank you both.

Original thread: https://forums.rpgmakerweb.com/threads/gold-value-based-on-party-level.88918/