I don't think there is a way to use a value from a SQL result as the parameter in a LIMIT clause.
Instead, you'll probably have to look into using a stored procedure so that you can define a variable, store the "limit" value from the other table into this variable, and then use the variable in the LIMIT clause of the second query.