const SPELL_DAMAGE = 4

function setPlayerAttributes(player) {
  const a2 = player.getAttribute("ars_nouveau:ars_nouveau.perk.spell_damage")
  if (a2) a2.setBaseValue(SPELL_DAMAGE)
}

PlayerEvents.loggedIn(event => {
  const player = event.player
  event.server.scheduleInTicks(20, () => {
    setPlayerAttributes(player)
  })
})


PlayerEvents.respawned(event => {
  const player = event.player
  event.server.scheduleInTicks(20, () => {
    setPlayerAttributes(player)
  })
})
