Another dimension

How would I go about to add my own ad hoc rule for the routing engine to consider?

For instance, let’s say that I want the time spent travelling between two nodes to also weight in on a function that considers some OSM attributes in the two nodes.