Orginal
http://www.yanfly.moe/wiki/Chain_Lightning_(MV_Plugin_Tips_&_Tricks)
<Damage Formula>
// Set the chain multiplier to a value if it doesn't exist.
this._chainmultiplier = this._chainmultiplier || 1.0;
// This is the damage formula.
value = user.mat + 1000;
// Apply the chain multiplier to the damage formula.
value *= this._chainmultiplier;
// Reduce the chain multiplier per target.
this._chainmultiplier -= 0.2;
</Damage Formula>
<Custom Target Eval>
// Adds the selected target to the target list.
targets.push(target);
// Grab the group of alive foes as candidates.
var members = foes.aliveMembers();
// Remove the target from the group of candidates.
members.splice(members.indexOf(target), 1);
// This is the number of extra targets to select with Chain Lightning.
var extraTargets = 3;
// Loop the extra targets.
while (extraTargets--) {
// Grab a random foe from the alive foes.
var member = members[Math.floor(Math.random() * members.length)];
// Check to see if the member exists.
if (member) {
// Add the member to the group of targets.
targets.push(member);
// Remove the member as a viable candidate.
members.splice(members.indexOf(member), 1);
}
}
</Custom Target Eval>
<Enemy or Actor Select>
Trying to convert it over to MZ
rmmz_managers.js:2030 SyntaxError: Unexpected token 'var'
at new Function (<anonymous>)
at Object.VisuMZ.<computed>.<computed> [as createTargetsJS] (VisuMZ_1_BattleCore.js:16134)
at Object.VisuMZ.<computed>.<computed> [as Parse_Notetags_Targets] (VisuMZ_1_BattleCore.js:16134)
at Object.VisuMZ.<computed> (VisuMZ_1_BattleCore.js:16134)
at Object.VisuMZ.<computed> (VisuMZ_1_MessageCore.js:1854)
at Object.VisuMZ.<computed> [as ParseSkillNotetags] (VisuMZ_1_SkillsStatesCore.js:2447)
at Object.VisuMZ.<computed> [as ParseAllNotetags] (VisuMZ_0_CoreEngine.js:7281)
at Scene_Boot.<computed> (VisuMZ_0_CoreEngine.js:7281)
at Scene_Boot.<computed>.onDatabaseLoaded (VisuMZ_1_BattleCore.js:16134)
at Scene_Boot.<computed>.<computed> (VisuMZ_1_ElementStatusCore.js:3330)
[TABLE]
[TR]
[TD]
SceneManager.catchNormalError[/TD]
[TD]@[/TD]
[TD]rmmz_managers.js:2030[/TD]
[/TR]
[/TABLE]
<JS Pre-Damage>
// Set the chain multiplier to a value if it doesn't exist.
this._chainmultiplier = this._chainmultiplier || 1.0;
// This is the damage formula.
value = user.mat*21 + user.level*6 - target.mdf*2;
// Apply the chain multiplier to the damage formula.
value *= this._chainmultiplier;
// Reduce the chain multiplier per target.
[this._chainmultiplier -= 0.2];
</JS Pre-Damage>
<JS Targets>
// Adds the selected target to the target list.
targets.push(target);
// Grab the group of alive foes as candidates.
var members = foes.aliveMembers();
// Not sure why the variable is flagging 
// tried $gameTroop.aliveMembers();
// Remove the target from the group of candidates.
members.splice(members.indexOf(target), 1);
// This is the number of extra targets to select with Chain Lightning.
var extraTargets = 4;
// Loop the extra targets.
while (extraTargets--) (
// Grab a random foe from the alive foes.
var member = members[Math.floor(Math.random() * members.length)];
// Check to see if the member exists.
if (member) (
// Add the member to the group of targets.
targets.push(member);
// Remove the member as a viable candidate.
[members.splice(members.indexOf(member), 1)];
)
)
</JS Targets>
Any help appreciated