How to implement a [y = −0.25x + 3.5] graph in a script?

Hello, I wanted to know how I would implement a [y = −0.25x + 3.5] graph in a script.
Example: if value a is 10, and value b is 5, i want the outcome to be 15, but when a is 100 and b is still 5, i want the value to be like 1, basically going down the more a is.

But in fashion of the graph [y = −0.25x + 3.5].

I’m kind of confused when it comes to math. Please help me out, thanks.

You could use a function to achieve this.

function findY(x)
    return (-0.25*x) + 3.5
end

y = findY(10) -- 1