There's a lot of code reuse between all these effect functions. It shouldn't be hard to represent each of these effects as a table which has all the relevant fields and a single function to apply all the things from a table.