I was searching around for a script to add equipped weapon elements to skills. I found this one but i am getting an error whenever i use a tagged skill. I was wondering if anyone can tell me what is wrong with it or help me get a new one. I also want to make sure that the weapon elements add to the skills elements and not over write them. The original topic i got the code from is closed.

this is the code i am using made by zetu
CODE
#-------------------------------------------------------------------------------
#Add Equipped Weapon Element to Skill
#Add <w elemental> tag to whatever skill tag box you'd like to have weapon
#element added
#-------------------------------------------------------------------------------

class Game_Battler
  
  alias z_make_obj_damage_value make_obj_damage_value unless $@
  def make_obj_damage_value(user, obj)
    recreate_element_set(user, obj)
    z_make_obj_damage_value(user, obj)
  end
  
  def recreate_element_set(user, obj)
    return unless user.actor?
    return unless obj.welemental
    obj.element_set = []
    return if user.weapons[0].nil?
    obj.element_set = weapons[0].element_set
  end
  
end

class RPG::Weapon /i){
    return true}
    return false
  end
  
end


this is the line of code that errors

CODE
return unless obj.welemental


this is the error that i get

-----------------------------------------------------------------------
script 'weapon skills' line 17: NoMethodError occurred.

undefined method 'welemental' for #<RPG::Skill:0x14237f0>
-----------------------------------------------------------------------

Any help would be greatly appreciated i can't find a code like this anywhere. And I really need i for my game

here is a list of the scripts i use
  • YERD_StatusResistFix
  • YERD_MonsterReappearFix
  • YERD_InterfaceFix
  • YERD_BitmapFix
  • YERD_UseItemFix
  • YERD_ShowSkillFix
  • YERD_AnimationFix
  • YERD_TurnOrderFix
  • YERD_SceneBattleRedux
  • YERD_TargetEffects
  • YERD_VictoryAftermath
  • YERD_StatusEffects
  • YERD_ItemAbilities
  • YEM Swap Random Monster
  • YERD_EnemyLevelControl
  • YERD_PartyDisplay 2.0
  • Party Manager
  • module Ladder_Config
  • Item Price Changer
  • Map Effect Pack 1
  • XP Control
  • Map Credit
  • Restore HP on Guard
  • Row Changer
  • Tag Note 2.0
  • Variable Criticals
  • Enhanced Game Over
  • Kreads AI Package
  • disc changer VX
  • Tileset Reader VX
  • Encounter Control
  • Battle Background
  • terrain_battleback
  • KGC_DayNight
  • cursor sprite
  • Paragraph Formatter
  • Quest Journal
  • Multi-Slot Equipment VX
  • YERD_ExtendedEquip
  • Enemy HP Window