It looks bit wrong, you need to save that what kind of type "Str / Def / Int …" is this spell into spell.dat from editor, so mess with source where it saves it, also recs if im not wrong, and then make check when the spell is used with if, or better select case. I have forgor mostly everything about eo code but it should be smtn like this Primary as byte ( as example and then thisPrimary data will be from 1 to 4 or how many attributes are there.)