Ответ 1
Вы можете установить интервал, который уменьшает значение, если мышь не двигается, и очистите его при его перемещении, и reset он, что-то вроде этого:
$(document).ready(function() {
var score = 0, decreaseInterval, intervalTime = 1000;
function decrease() {
if (score > 0) score--;
$("#result").val(score);
};
decreaseInterval = setInterval(decrease, intervalTime);
$("body").mousemove(function(){
clearInterval(decreaseInterval);
score ++;
$("#result").val(score);
decreaseInterval = setInterval(decrease, intervalTime);
console.log(score);
});
});
Вот скрипка, демонстрирующая ее работу: https://jsfiddle.net/0swrae76/1/