New to Godot: Updating changing spinbox variables (from input) in equations

Godot Version

Godot 4

Question

Hi everyone, I’m working on a custom project which is basically a D&D character sheet, and I am having a hard time connecting my input to the altering of the variables. I have a UI built from a series of spinboxes, so for an editable spinbox named $MoraleScore and an uneditable spinbox with the result of an equation $MoraleMod, with a value_changed signal, I have:

@onready var morale: int = $MoraleScore.value

func modifiers()

var morale_mod = (morale - 10) / 2

$MoraleMod.value = morale_mod

func on_morale_score_value_changed(value: int):

morale = value

I can tell the value is changing from printing the result, so am I missing a step in updating the value in the equation? I am very new to this so any help as well as any explanations would be extremely helpful.

First, please format your code.

Second, you are only running that equation once. You need to update it every time morale is updated.