I can't find anything in the code that jumps out to me as being likely to cause it, if you could provide a screenshot for it I might be able to figure out where it's going wrong.
So, I might have accidentally found the fix for it. When going about and making the spacing of the stuff all use the new text, I noticed that I'd forgotten to have the item defence call the correct object when it was equal to your current equipments defence, so that's probably where the undefined was coming from, so, it should actually be fixed now too. If it still shows up at any point, grab a screenshot and I'll see what I can do to fix, but hopefully should be good now.