Well, it's a function that returns a boolean. So it's giving
true or false, which are reserved words and their own values in JavaScript - they are neither numeric nor strings, they are boolean.My mistake was the operation precedence (order of operations) - in JavaScript, the ternary operator is of lower precedence than multiplication, so it was multiplying "user.mat*true/false" before checking the truth of that...which obviously doesn't work.
It works if you put parentheses around it:
Math.floor(user.mat * (target.states().includes($dataStates[32]) ? 0.3 : 0.5));