So I've been pondering about constant functions. I heard that constant functions always return a constant return value. However, this seems to work. JASS: private constant function GetDamage takes integer level returns real return level * 5. endfunction By right, the above function can't be a constant, right?

A constant function is a function that does not call any other non-constant functions and does not use the set statement. Following this, the function you posted is indeed constant. In practice, constant functions are used (as your example shows) to denote data such as spell configuration. In terms of execution speed, it is absolutely the same as a non-constant function, however, Vexorian's map optimizer will always try to inline constant functions, which would ultimately result in a minor speed gain (note that JassHelper can also inline stuff, but the optimizer's inlining is much more "powerful"). There's also a consant function inliner by blu_da_noob (I haven't tested that one recently, but last time I did, it worked fine).

really the idea is, you allow users easy customization of spells/systems using the constant function - but then enable the speed efficiency of in-lining during processing