If you want to add a trait to a given actor:
Code:
$gameActors.actor(ACTOR ID).actor().traits.push({code: CODE, dataId: ID, value: VALUE})
If you want to add one to the actor's class:
Code:
$gameActors.actor(ACTOR ID).currentClass().traits.push({code: CODE, dataId: ID, value: VALUE})
If you want to add one to the party leader:
Code:
$gameParty.leader().actor().traits.push({code: CODE, dataId: ID, value: VALUE})
Or party leader's class:
Code:
$gameParty.leader().currentClass().traits.push({code: CODE, dataId: ID, value: VALUE})
Where CODE, ID and VALUE are determined as follows:
Element rate = 11 (ID starts at 1 for "physical", increasing by 1 for each element ID you've defined)
Debuff rate = 12 (ID start at 0 - Max HP, Max MP, Attack, Defence, M Attack, M Defence, Agility, Luck)
State rate = 13 (ID starts at 1 for "death", increasing by 1 for each state you've defined)
State resist = 14 (ID starts at 1 for "death" increasing by 1 for each state you've defined)
Param = 21 (ID starts at 0 - Max HP, Max MP, Attack, Defence, M Attack, M Defence, Agility, Luck)
Ex-Param = 22 (ID starts at 0 - Hit Rate, Evasion Rate, Critical Rate, Critical Evasion, Magic Evasion, Magic Reflection, Counter Attack, HP Regeneration, MP Regeneration, TP Regeneration)
Sp-Param = 23 (ID starts at 0 - Target Rate, Guard Effect, Recovery Effect, Pharmacology, MP Cost Rate, TP Charge Rate, Physical Damage, Magical Damage, Floor Damage, Experience)
Attack element = 31 (ID starts at 1 for "physical", increasing by 1 for each element ID you've defined)
Attack state = 32 (ID starts at 1 for "death", increasing by 1 for each state you've defined)
Attack speed = 33 (ID will always be 0)
Attack times = 34 (ID will always be 0)
Add skill type = 41 (ID starts at 1, increasing by 1 for each skill type defined)
Seal skill type = 42 (ID starts at 1, increasing by 1 for each skill type defined)
Add skill = 43 (ID starts at 1, increasing by 1 for each skill defined)
Seal skill = 44 (ID starts at 1, increasing by 1 for each skill defined)
Add weapon type = 51 (ID starts at 1, +1 for each weapon)
Add armour type = 52 (ID starts at 1, +1 for each armour)
Lock equip = 53 (ID starts at 1, +1 for each equip slot)
Seal equip = 54 (ID starts at 1, +1 for each equip slot
Slot type = 55 (ID will always be 0)
Action+ = 61 (ID will always be 0)
Special flag = 62 (ID starts at 0 - Auto Battle, Guard, Substitute, Preserve TP)
Collapse type = 63 (ID starts at 0 - Normal, Boss, Instant, No Disappear)
Party ability = 64 (ID starts at 0 - Encounter Half, Encounter None, Cancel Surprise, Raise Preemptive, Gold Double, Item Drop Double)
For percentage-based traits (Element rate, debuff rate etc.) VALUE is a percentage expressed as a fraction, 1 being 100%. So for 50% you'd put 0.5, for 150% you'd put 1.5, and so on.
For flat rate traits like attack speed, the VALUE is the amount you want to raise/lower it by. So if you wanted +5 attack speed, you'd just put 5. For -5 attack speed, you'd put -5.
For traits that add skill types, skills, flags etc. VALUE will always be 1.